Skip to content

Commit

Permalink
fix: use forward slashes when normalizing path (#9768)
Browse files Browse the repository at this point in the history
Fixes #9766
  • Loading branch information
truemogician authored Feb 9, 2023
1 parent 099fcd9 commit 58fc088
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 on Windows.
*/
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

1 comment on commit 58fc088

@zivCheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update will cause Windows to fail to find the entity files.

Please sign in to comment.