mirror of
https://github.com/appleboy/drone-scp.git
synced 2026-06-04 18:23:59 +08:00
fix tar multiple folder or file.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user