diff --git a/.changeset/spicy-terms-grin.md b/.changeset/spicy-terms-grin.md new file mode 100644 index 000000000..5394ac0e9 --- /dev/null +++ b/.changeset/spicy-terms-grin.md @@ -0,0 +1,5 @@ +--- +'providence-analytics': patch +--- + +Relative source path util take posix path for both full path and root path, to ensure the replace happens properly. diff --git a/packages/providence-analytics/src/program/utils/relative-source-path.js b/packages/providence-analytics/src/program/utils/relative-source-path.js index 74bfcd6c3..347b7aacd 100644 --- a/packages/providence-analytics/src/program/utils/relative-source-path.js +++ b/packages/providence-analytics/src/program/utils/relative-source-path.js @@ -20,7 +20,7 @@ function isRelativeSourcePath(source) { * @param {string} rootPath like '/path/to/repo' */ function toRelativeSourcePath(fullPath, rootPath) { - return toPosixPath(fullPath).replace(rootPath, '.'); + return toPosixPath(fullPath).replace(toPosixPath(rootPath), '.'); } module.exports = { isRelativeSourcePath, toRelativeSourcePath };