fix: handle trailing backslash on windows path when quoting

pull/13705/head
JalonSolov 2022-03-09 14:32:37 -05:00
parent 7231a3f135
commit 9bb848bb61
1 changed files with 5 additions and 1 deletions

View File

@ -761,7 +761,11 @@ pub fn execute_or_exit(cmd string) Result {
// quoted path - return a quoted version of the path, depending on the platform.
pub fn quoted_path(path string) string {
$if windows {
return '"$path"'
if path.ends_with(path_separator) {
return '"${path + path_separator}"'
} else {
return '"$path"'
}
} $else {
return "'$path'"
}