mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 20:57:44 +00:00
fix: fix push uploads to the wrong path on windows (#240)
This commit is contained in:
@@ -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, '/');
|
||||
}
|
||||
Reference in New Issue
Block a user