fix: fix push uploads to the wrong path on windows (#240)

This commit is contained in:
Roman Hotsiy
2021-01-09 20:03:02 +02:00
committed by GitHub
parent 1a30fbfab6
commit be707fab1c
3 changed files with 37 additions and 3 deletions

View File

@@ -281,3 +281,16 @@ export function exitWithError(message: string) {
process.stderr.write(red(message)+ '\n\n');
process.exit(1);
}
/**
* Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
*/
export function slash(path: string): string {
const isExtendedLengthPath = /^\\\\\?\\/.test(path)
if (isExtendedLengthPath) {
return path
}
return path.replace(/\\/g, '/');
}