int128 / gradle-ssh-plugin

Gradle SSH Plugin

Home Page:https://gradle-ssh-plugin.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SCP file with a negative filter

szaluk opened this issue · comments

Environment info

id 'org.hidetake.ssh' version '2.9.0'

I am trying to scp files from a remote location and in the process I want to exclude a directory. I tried to add the following filter:

task test() {
    doLast {
        ssh.run {
            session(remotes.appBlade) {
                get from: '/remote/log/*', into: '/local/log', filter: { !(it.name =~ /soa$/) }
            }
        }
    }
}

The directory I want to exclude is called soa and it is a dead link (the directory it links to doesn't exist). Even with this filter set, I am getting the following:

* What went wrong:
Execution failed for task ':test'.
> Error while stream interaction: java.lang.IllegalStateException: SCP command returned error: scp: /remote/log/soa: No such file or directory

Is this an issue or am I doing it wrong?

Thanks,
Steve