Skip to content

Commit

Permalink
fix(pnpify): remove leading slash on windows in removeZipPrefix (yarn…
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Jul 1, 2020
1 parent 2855219 commit 5a19b1f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const moduleWrapper = tsserver => {
}

function removeZipPrefix(str) {
return str.replace(/^zip:/, ``);
return process.platform === 'win32'
? str.replace(/^zip:\//, ``)
: str.replace(/^zip:/, ``);
}
};

Expand Down
9 changes: 9 additions & 0 deletions .yarn/versions/35658422.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@yarnpkg/pnpify": prerelease

declined:
- "@yarnpkg/plugin-node-modules"
- vscode-zipfs
- "@yarnpkg/builder"
- "@yarnpkg/cli"
- "@yarnpkg/pnp"
4 changes: 3 additions & 1 deletion packages/yarnpkg-pnpify/sources/sdks/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export const generateTypescriptBaseWrapper: GenerateBaseWrapper = async (pnpApi:
}
function removeZipPrefix(str) {
return str.replace(/^zip:/, \`\`);
return process.platform === 'win32'
? str.replace(/^zip:\\//, \`\`)
: str.replace(/^zip:/, \`\`);
}
};
`;
Expand Down

0 comments on commit 5a19b1f

Please sign in to comment.