Skip to content

Commit

Permalink
Fix: Avoid recommending npm if yarn should be used (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdukes authored and phated committed May 20, 2020
1 parent d827191 commit c1b261c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,15 @@ function handleArguments(env) {
ansi.red(missingGulpMessage),
ansi.magenta(tildify(env.cwd))
);
var hasYarn = fs.existsSync(path.join(env.cwd, 'yarn.lock'));
/* istanbul ignore next */
var installCommand =
missingNodeModules
? 'npm install'
? hasYarn
? 'yarn install'
: 'npm install'
: hasYarn
? 'yarn add gulp'
: 'npm install gulp';
log.error(ansi.red('Try running: ' + installCommand));
exit(1);
Expand Down

0 comments on commit c1b261c

Please sign in to comment.