mirror of
https://github.com/appleboy/drone-scp.git
synced 2026-07-06 16:02:15 +08:00
41313253fa
- Add a test for a target folder with spaces in the name - Fix a bug in the `buildUnTarArgs` function that caused it to fail when receiving a target with spaces - Remove unused code in the `TestRemoveDestFile` function ref https://github.com/appleboy/scp-action/issues/85
23 lines
375 B
Go
23 lines
375 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 ""
|
|
}
|