aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-06-13 08:33:30 +0700
committerShulhan <ms@kilabit.info>2019-06-13 08:33:30 +0700
commit374bfc155857877f9638ccae37baacef01dc4b6a (patch)
tree1051cd8e12b413c9870a8d540861b99010e10f9e
parent9ac8ed292f48dd204b7eb6ab3b41903bc16c00da (diff)
downloadpakakeh.go-374bfc155857877f9638ccae37baacef01dc4b6a.tar.xz
ssh/client: add recursive option for Get and Put commands
-rw-r--r--lib/ssh/client.go4
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