Skip to content

Commit

Permalink
lib: fix npm pack
Browse files Browse the repository at this point in the history
Closes `stdin` and `stderr` when calling `npm pack`. This makes CITGM
work with more recent versions of `npm`.

Fixes: #593
  • Loading branch information
bzoz authored and MylesBorins committed Sep 27, 2018
1 parent 727359e commit 595dcf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions lib/grab-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ function grabProject(context, next) {
let bailed = false;
context.emit('data', 'info', context.module.name + ' npm:',
'Downloading project: ' + packageName);
const proc =
spawn(
'npm',
['pack', packageName],
createOptions(
context.path,
context));
let options = createOptions(context.path, context);
options.stdio = ['ignore', 'pipe', 'ignore'];
const proc = spawn('npm', ['pack', packageName], options);

let filename = '';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"scripts": {
"test": "npm run lint && npm run tap",
"tap": "tap -J --timeout 120 \"test/**/test-*.js\"",
"tap": "tap -J --timeout 240 \"test/**/test-*.js\"",
"coverage": "npm run tap -- --coverage",
"coverage-html": "npm run tap -- --coverage --coverage-report=html",
"lint": "eslint bin/* lib/ test/ --cache"
Expand Down

0 comments on commit 595dcf6

Please sign in to comment.