Skip to content

Commit

Permalink
fix: handling of choices
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jun 14, 2023
1 parent 92844ef commit 6b1844d
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,6 @@ module.exports = async function (items, env = true, global = true) {

if (choices) {
if (!prompt && prompt !== '' || !choices) continue;
for (let choice of Object.keys(choices)) {
let choiceKey = choices[choice].key
if (process.env[choiceKey]) {
config[choiceKey] = process.env[choiceKey];
return;
} else if (localConfig[choiceKey]) {
config[choiceKey] = localConfig[choiceKey];
return;

} else if (globalConfig[choiceKey]) {
config[choiceKey] = globalConfig[choiceKey];
return;
}
}

const answer = await promptForInput(prompt || `${key}: `);
const choice = choices[answer];
if (choice) {
Expand Down

0 comments on commit 6b1844d

Please sign in to comment.