Skip to content

Commit

Permalink
fix: extract symlinks from node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sumwatshade committed Jun 24, 2021
1 parent 7e691cd commit 52fc421
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ export async function extract(
});
} else shaValidated = true;

const ignore = (_: any, header: any) => {
const ignore = (name: string, header: any) => {
switch (header.type) {
case 'directory':
case 'file':
if (process.env.OCLIF_DEBUG_UPDATE_FILES) debug(header.name);
return false;
case 'symlink':
return true;
// If the binary is within node_modules/.bin, then we want to hold that symlink
return name.indexOf('node_modules/.bin') === -1;
default:
throw new Error(header.type);
}
Expand Down

0 comments on commit 52fc421

Please sign in to comment.