diff --git a/README.md b/README.md index e2e6cfb..a887a21 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Load all environments from file. ```bash docker run --rm \ -e ENV_FILE=your_env_file_path \ - -e PLUGIN_KEY="$(cat ${HOME}/.ssh/id_rsa)" + -e PLUGIN_KEY="$(cat ${HOME}/.ssh/id_rsa)" \ -v $(pwd):$(pwd) \ -w $(pwd) \ appleboy/drone-scp diff --git a/plugin.go b/plugin.go index 041f0df..778a68a 100644 --- a/plugin.go +++ b/plugin.go @@ -83,7 +83,6 @@ func (p Plugin) Exec() error { } files := trimPath(p.Config.Source) - src := strings.Join(files, " ") dest := fmt.Sprintf("%s-%s.tar", p.Repo.Name, p.Build.Commit[:7]) // create a temporary file for the archive @@ -95,7 +94,8 @@ func (p Plugin) Exec() error { // run archive command log.Println("tar all files into " + tar) - cmd := exec.Command("tar", "-cf", tar, src) + args := append(append([]string{}, "-cf", tar), files...) + cmd := exec.Command("tar", args...) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil {