Skip to content

Commit 4109838

Browse files
committed
fix: use escape-path-with-spaces to fix new windows paths
1 parent 51704ac commit 4109838

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@actions/exec": "^1.1.1",
3838
"@actions/io": "^1.1.2",
3939
"@actions/tool-cache": "^1.7.2",
40+
"escape-path-with-spaces": "^1.0.0",
4041
"execa": "^5.1.1",
4142
"mri": "^1.2.0",
4243
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/path/escape_space.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2+
// @ts-ignore
3+
import escape from "escape-path-with-spaces"
4+
15
/// Escape the spaces in the given path
26
export function escapeSpace(path: string | undefined): string {
37
if (path === undefined) {
48
return ""
59
}
6-
if (process.platform === "win32") {
7-
return path.replace(/(\s+)/g, "%20")
8-
} else {
9-
return path.replace(/(\s+)/g, "\\$1")
10-
}
10+
return escape(path)
1111
}

0 commit comments

Comments
 (0)