mirror of
https://github.com/appleboy/drone-scp.git
synced 2026-03-05 23:17:02 -05:00
- Modify `rmcmd` and `mkdircmd` to remove unneeded quotes - Update `buildUnTarArgs` in `plugin.go` to use target without quotes - Add `Exec` function to `plugin.go` with `strings.Replace` call - Update tests in `plugin_test.go` to use target without quotes ref: https://github.com/appleboy/scp-action/issues/112
23 lines
361 B
Go
23 lines
361 B
Go
package main
|
|
|
|
func rmcmd(os, target string) string {
|
|
switch os {
|
|
case "windows":
|
|
return "DEL /F /S " + target
|
|
case "unix":
|
|
return "rm -rf " + target
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func mkdircmd(os, target string) string {
|
|
switch os {
|
|
case "windows":
|
|
return "if not exist " + target + " mkdir " + target
|
|
case "unix":
|
|
return "mkdir -p " + target
|
|
}
|
|
|
|
return ""
|
|
}
|