diff options
| author | Shulhan <ms@kilabit.info> | 2019-06-13 08:33:30 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2019-06-13 08:33:30 +0700 |
| commit | 374bfc155857877f9638ccae37baacef01dc4b6a (patch) | |
| tree | 1051cd8e12b413c9870a8d540861b99010e10f9e | |
| parent | 9ac8ed292f48dd204b7eb6ab3b41903bc16c00da (diff) | |
| download | pakakeh.go-374bfc155857877f9638ccae37baacef01dc4b6a.tar.xz | |
ssh/client: add recursive option for Get and Put commands
| -rw-r--r-- | lib/ssh/client.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssh/client.go b/lib/ssh/client.go index 7da0da45..aa9b23b4 100644 --- a/lib/ssh/client.go +++ b/lib/ssh/client.go @@ -113,7 +113,7 @@ func (cl *Client) Get(remote, local string) (err error) { remote = fmt.Sprintf("%s@%s:%s", cl.cfg.RemoteUser, cl.cfg.RemoteHost, remote) - cmd := exec.Command("scp", "-i", cl.cfg.PrivateKeyFile, + cmd := exec.Command("scp", "-r", "-i", cl.cfg.PrivateKeyFile, "-P", cl.cfg.remotePort, remote, local) cmd.Dir = cl.cfg.WorkingDir @@ -147,7 +147,7 @@ func (cl *Client) Put(local, remote string) (err error) { remote = fmt.Sprintf("%s@%s:%s", cl.cfg.RemoteUser, cl.cfg.RemoteHost, remote) - cmd := exec.Command("scp", "-i", cl.cfg.PrivateKeyFile, + cmd := exec.Command("scp", "-r", "-i", cl.cfg.PrivateKeyFile, "-P", cl.cfg.remotePort, local, remote) cmd.Dir = cl.cfg.WorkingDir |
