Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit 357e6ab

Browse files
Noah Leighzkat
authored andcommitted
fix(index): remove extraneous logging on Windows (#136)
Windows logs the path to the downloaded module, which doesn't match Unix behavior. Fixes: #131
1 parent 93c86e3 commit 357e6ab

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ function findNodeScript (existing, opts) {
351351
return str.match(cmd) || str.match(mingw)
352352
}).then(match => {
353353
return match && path.join(path.dirname(existing), match[1])
354-
}).then(x => console.log(x) || x)
354+
})
355355
}
356356
})
357357
}

test/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,14 @@ test('npx with custom installer stdio', t => {
270270
t.end()
271271
})
272272
})
273+
274+
test('noisy npx with --quiet arg on windows', {
275+
skip: !isWindows && 'Only on Windows does the path to the downloaded module get printed'
276+
}, t => {
277+
return child.spawn('node', [
278+
NPX_ESC, '--quiet', 'echo-cli', 'hewwo'
279+
], {stdio: 'pipe'}).then(res => {
280+
t.equal(res.stdout.trim(), 'hewwo')
281+
t.end()
282+
})
283+
})

0 commit comments

Comments
 (0)