os: handle trailing backslash on windows path when quoting (#13705)

pull/13710/head
JalonSolov 2022-03-09 17:29:37 -05:00 committed by GitHub
parent 7231a3f135
commit de2fc87995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -761,7 +761,7 @@ 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"'
return if path.ends_with(path_separator) { '"${path + path_separator}"' } else { '"$path"' }
} $else {
return "'$path'"
}