Skip to content

Commit

Permalink
Fix help
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppeg committed Sep 15, 2020
1 parent 8eab42e commit 61bc6a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ const cmds = ["dev", "build", "help"];
const cmd = args.shift();

if (!cmds.includes(cmd)) {
log(
`Invalid command <u>${cmd || ""}</u>. Valid commands are ${cmds
.map((c) => `<u>${c}</u>`)
.join(" ")}.`
);
if (cmd) {
log(
`Invalid command <u>${cmd || ""}</u>. Valid commands are ${cmds
.map((c) => `<u>${c}</u>`)
.join(" ")}.`
);
} else {
help();
}
process.exit(1);
}

Expand Down
9 changes: 6 additions & 3 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ module.exports.help = function help() {
log(`Usage: ${name} <command> [options]\n`);

log(`Commands:\n`);
log(` <b>dev</b> Compiles and watches the root folder`, {
prefix: false,
});
log(
` <b>dev</b> Compiles HTML files on change and serves the root folder`,
{
prefix: false,
}
);
log(` <b>build</b> Compiles the HTML files once`, { prefix: false });
log(` <b>help</b> Displays help`, { prefix: false });

Expand Down

0 comments on commit 61bc6a7

Please sign in to comment.