Skip to content

Commit

Permalink
fix: use forward slashes when normalizing path
Browse files Browse the repository at this point in the history
  • Loading branch information
truemogician committed Feb 9, 2023
1 parent 099fcd9 commit b3c7116
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/platform/PlatformTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,13 @@ export class PlatformTools {
}

/**
* Normalizes given path. Does "path.normalize".
* Normalizes given path. Does "path.normalize" and replaces backslashes with forward slashes.
*/
static pathNormalize(pathStr: string): string {
return path.normalize(pathStr)
let normalizedPath = path.normalize(pathStr)
if (process.platform === "win32")
normalizedPath = normalizedPath.replace(/\\/g, "/")
return normalizedPath
}

/**
Expand Down

0 comments on commit b3c7116

Please sign in to comment.