Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
fix(index): remove extraneous logging on Windows (#136)
Browse files Browse the repository at this point in the history
Windows logs the path to the downloaded module, which doesn't match Unix behavior.

Fixes: #131
  • Loading branch information
Noah Leigh authored and zkat committed Dec 3, 2017
1 parent 93c86e3 commit 357e6ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ function findNodeScript (existing, opts) {
return str.match(cmd) || str.match(mingw)
}).then(match => {
return match && path.join(path.dirname(existing), match[1])
}).then(x => console.log(x) || x)
})
}
})
}
Expand Down
11 changes: 11 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,14 @@ test('npx with custom installer stdio', t => {
t.end()
})
})

test('noisy npx with --quiet arg on windows', {
skip: !isWindows && 'Only on Windows does the path to the downloaded module get printed'
}, t => {
return child.spawn('node', [
NPX_ESC, '--quiet', 'echo-cli', 'hewwo'
], {stdio: 'pipe'}).then(res => {
t.equal(res.stdout.trim(), 'hewwo')
t.end()
})
})

0 comments on commit 357e6ab

Please sign in to comment.