Skip to content

Commit

Permalink
refactor: simplify some code in Netlify Dev (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Aug 2, 2020
1 parent 582e17f commit 1a9ff36
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/utils/detect-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,15 @@ function filterSettings(scriptInquirerOptions, input) {

/** utiltities for the inquirer section above */
function formatSettingsArrForInquirer(settingsArr) {
const ans = []
settingsArr.forEach(setting => {
setting.possibleArgsArrs.forEach(args => {
ans.push({
return [].concat(
...settingsArr.map(setting =>
setting.possibleArgsArrs.map(args => ({
name: `[${chalk.yellow(setting.framework)}] ${setting.command} ${args.join(' ')}`,
value: { ...setting, args },
short: setting.framework + '-' + args.join(' '),
})
})
})
return ans
}))
)
)
}
// if first arg is undefined, use default, but tell user about it in case it is unintentional
function assignLoudly(
Expand Down

0 comments on commit 1a9ff36

Please sign in to comment.