mirror of
https://github.com/appleboy/drone-scp.git
synced 2026-06-04 10:15:05 +08:00
chore: debug command
This commit is contained in:
@@ -202,14 +202,17 @@ func (p *Plugin) Args(target string) []string {
|
||||
p.Config.TarExec,
|
||||
"-xf",
|
||||
p.DestFile,
|
||||
"-C",
|
||||
target,
|
||||
)
|
||||
|
||||
if p.Config.StripComponents > 0 {
|
||||
args = append(args, fmt.Sprintf("-strip-components=%d", p.Config.StripComponents))
|
||||
}
|
||||
|
||||
args = append(args,
|
||||
"-C",
|
||||
target,
|
||||
)
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
@@ -318,6 +321,9 @@ func (p *Plugin) Exec() error {
|
||||
// untar file
|
||||
p.log(host, "untar file", p.DestFile)
|
||||
commamd := strings.Join(p.Args(target), " ")
|
||||
if p.Config.Debug {
|
||||
fmt.Println("$", commamd)
|
||||
}
|
||||
_, _, _, err = ssh.Run(commamd, p.Config.CommandTimeout)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -267,6 +267,7 @@ func TestIgnoreList(t *testing.T) {
|
||||
Target: []string{filepath.Join(u.HomeDir, "ignore")},
|
||||
CommandTimeout: 60 * time.Second,
|
||||
TarExec: "tar",
|
||||
Debug: true,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user