Skip to content

Commit 5a19b1f

Browse files
authored
fix(pnpify): remove leading slash on windows in removeZipPrefix (#1534)
1 parent 2855219 commit 5a19b1f

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.yarn/sdks/typescript/lib/tsserver.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ const moduleWrapper = tsserver => {
4646
}
4747

4848
function removeZipPrefix(str) {
49-
return str.replace(/^zip:/, ``);
49+
return process.platform === 'win32'
50+
? str.replace(/^zip:\//, ``)
51+
: str.replace(/^zip:/, ``);
5052
}
5153
};
5254

.yarn/versions/35658422.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
releases:
2+
"@yarnpkg/pnpify": prerelease
3+
4+
declined:
5+
- "@yarnpkg/plugin-node-modules"
6+
- vscode-zipfs
7+
- "@yarnpkg/builder"
8+
- "@yarnpkg/cli"
9+
- "@yarnpkg/pnp"

packages/yarnpkg-pnpify/sources/sdks/base.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ export const generateTypescriptBaseWrapper: GenerateBaseWrapper = async (pnpApi:
7373
}
7474
7575
function removeZipPrefix(str) {
76-
return str.replace(/^zip:/, \`\`);
76+
return process.platform === 'win32'
77+
? str.replace(/^zip:\\//, \`\`)
78+
: str.replace(/^zip:/, \`\`);
7779
}
7880
};
7981
`;

0 commit comments

Comments
 (0)