Files
plugin-drone-scp/command.go
T
Bo-Yi Wu 41313253fa fix: improve support for folder names with spaces (#174)
- 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
2023-04-11 12:54:53 +08:00

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 ""
}