fix(providence-analytics): fix relative source path util for windows
This commit is contained in:
parent
9a7522f844
commit
3cd1cf95e0
2 changed files with 6 additions and 1 deletions
5
.changeset/spicy-terms-grin.md
Normal file
5
.changeset/spicy-terms-grin.md
Normal file
|
|
@ -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.
|
||||
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Reference in a new issue