mirror of https://github.com/aminya/setup-cpp
fix: use escape-path-with-spaces to fix new windows paths
This commit is contained in:
parent
51704ac849
commit
4109838bca
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -37,6 +37,7 @@
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.2",
|
"@actions/io": "^1.1.2",
|
||||||
"@actions/tool-cache": "^1.7.2",
|
"@actions/tool-cache": "^1.7.2",
|
||||||
|
"escape-path-with-spaces": "^1.0.0",
|
||||||
"execa": "^5.1.1",
|
"execa": "^5.1.1",
|
||||||
"mri": "^1.2.0",
|
"mri": "^1.2.0",
|
||||||
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
|
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
|
||||||
|
|
|
@ -23,6 +23,7 @@ specifiers:
|
||||||
cross-env: 7.0.3
|
cross-env: 7.0.3
|
||||||
cross-spawn: ^7.0.3
|
cross-spawn: ^7.0.3
|
||||||
cspell: ^5.20.0
|
cspell: ^5.20.0
|
||||||
|
escape-path-with-spaces: ^1.0.0
|
||||||
eslint: ^8.14.0
|
eslint: ^8.14.0
|
||||||
eslint-config-atomic: ^1.17.1
|
eslint-config-atomic: ^1.17.1
|
||||||
execa: ^5.1.1
|
execa: ^5.1.1
|
||||||
|
@ -52,6 +53,7 @@ dependencies:
|
||||||
'@actions/exec': 1.1.1
|
'@actions/exec': 1.1.1
|
||||||
'@actions/io': 1.1.2
|
'@actions/io': 1.1.2
|
||||||
'@actions/tool-cache': 1.7.2
|
'@actions/tool-cache': 1.7.2
|
||||||
|
escape-path-with-spaces: 1.0.0
|
||||||
execa: 5.1.1
|
execa: 5.1.1
|
||||||
mri: 1.2.0
|
mri: 1.2.0
|
||||||
msvc-dev-cmd: github.com/aminya/msvc-dev-cmd/9f672c1
|
msvc-dev-cmd: github.com/aminya/msvc-dev-cmd/9f672c1
|
||||||
|
@ -3588,6 +3590,10 @@ packages:
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/escape-path-with-spaces/1.0.0:
|
||||||
|
resolution: {integrity: sha512-+98Hh0yzVa0hldJXlzr0M/8B8LVXW9vNT5boC9k6o896Z52DGRplm3NwMGX0590ryGSegzTf/uaUiusFj2SQbQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/escape-string-regexp/1.0.5:
|
/escape-string-regexp/1.0.5:
|
||||||
resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=}
|
resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=}
|
||||||
engines: {node: '>=0.8.0'}
|
engines: {node: '>=0.8.0'}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
import escape from "escape-path-with-spaces"
|
||||||
|
|
||||||
/// Escape the spaces in the given path
|
/// Escape the spaces in the given path
|
||||||
export function escapeSpace(path: string | undefined): string {
|
export function escapeSpace(path: string | undefined): string {
|
||||||
if (path === undefined) {
|
if (path === undefined) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
if (process.platform === "win32") {
|
return escape(path)
|
||||||
return path.replace(/(\s+)/g, "%20")
|
|
||||||
} else {
|
|
||||||
return path.replace(/(\s+)/g, "\\$1")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue