Skip to content

Commit

Permalink
fix #7 unsupported elm version because of unexpected npx output
Browse files Browse the repository at this point in the history
This should fix #7 which was due to npx bug
zkat/npx#144.
  • Loading branch information
rlefevre committed Dec 13, 2018
1 parent 393fe2d commit b832bc2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,11 @@ if ("version" in elmJson) {
/*
* Find and check Elm
*/
let elm = args => {
return spawn.sync("npx", ["--no-install", "elm"].concat(args));
};
let elm = args => spawn.sync("npx", ["--no-install", "elm"].concat(args));

let exec = elm(["--version"]);
if (exec.error) {
elm = args => {
return spawn.sync("elm", args);
};
if (exec.error || exec.status !== 0 || exec.stderr.toString().length > 0) {
elm = args => spawn.sync("elm", args);
exec = elm(["--version"]);
}

Expand Down

0 comments on commit b832bc2

Please sign in to comment.