Skip to content

Commit

Permalink
style: y u no love my semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
dominykas committed Mar 25, 2021
1 parent f948c0a commit dba9e00
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/generate-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ const getGeneralHelpOutput = (commandWithSubCommands = '') => {
/**
* Parses commands list block ands returns array of commands names
*/
const parseCommandsListOutput = (commandsOutput, commandWithSubCommands='') => {
const parseCommandsListOutput = (commandsOutput, commandWithSubCommands = '') => {
// parse commands list
const re = new RegExp(`^ {2}wiby ${commandWithSubCommands}([\\w-]+)`, 'gm')
const commandsList = []
let commandsParseResult
while ((commandsParseResult = re.exec(commandsOutput)) !== null) {
const [,command] = commandsParseResult;
const [, command] = commandsParseResult
if (command === 'github-workflow') {
const subCommandsOutput = getGeneralHelpOutput(`${command} `)
const subCommandList = parseCommandsListOutput(subCommandsOutput, `${command} `);
commandsList.push(...subCommandList.map((subCommand) => `${command} ${subCommand}`));
const subCommandList = parseCommandsListOutput(subCommandsOutput, `${command} `)
commandsList.push(...subCommandList.map((subCommand) => `${command} ${subCommand}`))
} else {
commandsList.push(command)
}
Expand Down

0 comments on commit dba9e00

Please sign in to comment.