mirror of
https://github.com/appleboy/drone-scp.git
synced 2026-06-04 10:15:05 +08:00
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
This commit is contained in:
+2
-2
@@ -5,7 +5,7 @@ func rmcmd(os, target string) string {
|
||||
case "windows":
|
||||
return "DEL /F /S " + target
|
||||
case "unix":
|
||||
return "rm -rf " + target
|
||||
return "rm -rf '" + target + "'"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -15,7 +15,7 @@ func mkdircmd(os, target string) string {
|
||||
case "windows":
|
||||
return "if not exist " + target + " mkdir " + target
|
||||
case "unix":
|
||||
return "mkdir -p " + target
|
||||
return "mkdir -p '" + target + "'"
|
||||
}
|
||||
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user