Skip to content

Commit

Permalink
New: Tailor message when local gulp is missing (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdukes authored and phated committed Mar 26, 2019
1 parent 927e055 commit c5a800c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,23 @@ function handleArguments(env) {
}

if (!env.modulePath) {
var missingNodeModules =
fs.existsSync(path.join(env.cwd, 'package.json'))
&& !fs.existsSync(path.join(env.cwd, 'node_modules'));

var missingGulpMessage =
missingNodeModules
? 'Local modules not found in'
: 'Local gulp not found in';
log.error(
ansi.red('Local gulp not found in'),
ansi.red(missingGulpMessage),
ansi.magenta(tildify(env.cwd))
);
log.error(ansi.red('Try running: npm install gulp'));
var installCommand =
missingNodeModules
? 'npm install'
: 'npm install gulp';
log.error(ansi.red('Try running: ' + installCommand));
exit(1);
}

Expand Down

0 comments on commit c5a800c

Please sign in to comment.