Skip to content

Commit b0ab346

Browse files
committed
fix: windows paths when pkgDir path has separators in it
1 parent 88595a6 commit b0ab346

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/shared/localShadowRepo.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,17 @@ export class ShadowRepo {
112112
if (!this.status || noCache) {
113113
try {
114114
await this.stashIgnoreFile();
115+
const filepaths =
116+
os.type() === 'Windows_NT'
117+
? // iso-git uses posix paths, but packageDirs has already normalized them so we need to convert if windows
118+
this.packageDirs.map((dir) => dir.path.split(path.sep).join(path.posix.sep))
119+
: this.packageDirs.map((dir) => dir.path);
115120
// status hasn't been initalized yet
116121
this.status = await git.statusMatrix({
117122
fs,
118123
dir: this.projectPath,
119124
gitdir: this.gitDir,
120-
filepaths: this.packageDirs.map((dir) => dir.path),
125+
filepaths,
121126
// filter out hidden files and __tests__ patterns, regardless of gitignore
122127
filter: (f) => !f.includes(`${path.sep}.`) && !f.includes('__tests__'),
123128
});

0 commit comments

Comments
 (0)