Skip to content

Commit 2d10684

Browse files
committed
chore: make src more readable
1 parent bd6b787 commit 2d10684

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/bootstrap.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ const cmdArgs = require('command-line-args');
44

55
require('./utils/process-log');
66

7-
const helpFlagPresent = args => args.find(arg => ['help', '--help'].indexOf(arg) !== -1);
7+
const isHelpFlagPresent = args => args.find(arg => ['help', '--help'].indexOf(arg) !== -1);
88

99
const normalizeFlags = (args, command) => args.slice(2).filter(arg => arg.indexOf('--') < 0 && arg !== command.name && arg !== command.alias);
1010

11-
const isCommandUsed = commands => commands.find(cmd => (cmd.alias ? process.argv.includes(cmd.name) || process.argv.includes(cmd.alias) : process.argv.includes(cmd.name)));
11+
const isCommandUsed = commands =>
12+
commands.find(cmd => {
13+
return process.argv.includes(cmd.name) || process.argv.includes(cmd.alias);
14+
});
1215

1316
async function runCLI(cli, commandIsUsed) {
1417
let args;
15-
const helpFlagExists = helpFlagPresent(process.argv);
18+
const helpFlagExists = isHelpFlagPresent(process.argv);
1619
if (helpFlagExists) {
1720
await cli.runHelp();
1821
return;

0 commit comments

Comments
 (0)