fix tar multiple folder or file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-11-29 15:29:03 +08:00
parent 7cd8855a53
commit 658203c26d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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 {