Search in sources :

Example 1 with PerlExecutionException

use of com.perl5.lang.perl.idea.sdk.host.PerlExecutionException in project Perl5-IDEA by Camelcade.

the class PerlDockerAdapter method copyRemote.

public void copyRemote(@NotNull String containerName, @NotNull String remotePath, @NotNull String localPath) throws ExecutionException {
    try {
        File localPathFile = new File(localPath);
        FileUtil.createDirectory(localPathFile);
        runCommand(COPY, AS_ARCHIVE, FOLLOWING_LINKS, containerName + ':' + remotePath, localPathFile.getParent());
    } catch (PerlExecutionException e) {
        ProcessOutput processOutput = e.getProcessOutput();
        String stderr = processOutput.getStderr();
        if (!stderr.contains("no such file or directory") && !stderr.contains("Could not find the file") && !stderr.contains("No such container:path")) {
            throw e;
        }
    }
}
Also used : PerlExecutionException(com.perl5.lang.perl.idea.sdk.host.PerlExecutionException) ProcessOutput(com.intellij.execution.process.ProcessOutput) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Aggregations

ProcessOutput (com.intellij.execution.process.ProcessOutput)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PerlExecutionException (com.perl5.lang.perl.idea.sdk.host.PerlExecutionException)1 File (java.io.File)1