Skip to content

Commit a4a0e2b

Browse files
authored
Prevent logs in commandExistsWindowsSync. fix #18
The default value of `stdio.options` in `execSync` is 'pipe'. That is *supposed* to be equivalent to `['pipe', 'pipe', 'pipe']`. In reality there seems to be a difference here - using the default (or 'pipe') results in the extra log. Using an array solves the issue.
1 parent 6ef128c commit a4a0e2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/command-exists.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var commandExistsUnixSync = function(commandName, cleanedCommandName) {
8989

9090
var commandExistsWindowsSync = function(commandName, cleanedCommandName, callback) {
9191
try {
92-
var stdout = execSync('where ' + cleanedCommandName);
92+
var stdout = execSync('where ' + cleanedCommandName, {stdio: []});
9393
return !!stdout;
9494
} catch (error) {
9595
return false;

0 commit comments

Comments
 (0)