Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

refactor(index): rewrite answer parsing #541

Merged
merged 20 commits into from
Dec 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
don't ask initial questions if config is set
  • Loading branch information
Haroenv committed Nov 26, 2021
commit 71c745ee5c051dcefb16caa50077e03477c7914c
5 changes: 3 additions & 2 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const getQuestions = ({ appName }) => ({
},
when(answers) {
try {
return !checkAppPath(answers.appPath);
return !answers.config && !checkAppPath(answers.appPath);
} catch (err) {
return true;
}
Expand All @@ -265,7 +265,7 @@ const getQuestions = ({ appName }) => ({
},
when(answers) {
try {
return !checkAppName(answers.appName);
return !answers.config && !checkAppName(answers.appName);
} catch (err) {
return true;
}
Expand All @@ -278,6 +278,7 @@ async function run() {
const args = {
appPath: appPathFromArgument,
appName: optionsFromArguments.name,
config: optionsFromArguments.config,
};
const initialQuestions = getQuestions({}).initial;
const initialAnswers = {
Expand Down