Skip to content

Commit

Permalink
chore: add code comment to npm/cli#7354 discussing 'npm pack' json issue
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Apr 16, 2024
1 parent 4f1aa37 commit a262e80
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/npm/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const getFilesToBePacked = async rootDirectory => {
const {stdout} = await execa('npm', ['pack', '--dry-run', '--json', '--silent'], {cwd: rootDirectory});

try {
// TODO: Remove this once [npm/cli#7354](https://github.com/npm/cli/issues/7354) is resolved.
const cleanStdout = stdout.replace(/^[^[]*\[/, '[').trim();
const {files} = JSON.parse(cleanStdout).at(0);
return files.map(file => file.path);
Expand Down

0 comments on commit a262e80

Please sign in to comment.