Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit c80da06

Browse files
authored
Resolved validate bug on Windows (#87)
1 parent 7aa4a2a commit c80da06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/commands/infra/validate.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import child_process from "child_process";
22
import commander from "commander";
33
import emoji from "node-emoji";
4+
import shelljs from "shelljs";
45
import { promisify } from "util";
56
import { Config } from "../../config";
67
import { logger } from "../../logger";
@@ -71,10 +72,8 @@ export const validatePrereqs = async (
7172
}
7273
// Validate executables in PATH
7374
for (const i of executables) {
74-
try {
75-
await promisify(child_process.exec)("which " + i);
76-
config.infra.checks[i] = true;
77-
} catch (err) {
75+
if (!shelljs.which(i)) {
76+
config.infra.checks[i] = false;
7877
if (globalInit === true) {
7978
logger.warn(i + " not installed.");
8079
} else {
@@ -83,7 +82,8 @@ export const validatePrereqs = async (
8382
);
8483
return false;
8584
}
86-
config.infra.checks[i] = false;
85+
} else {
86+
config.infra.checks[i] = true;
8787
}
8888
}
8989
return true;

0 commit comments

Comments
 (0)