Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 3eb3e2c

Browse files
authored
Merge pull request #218 from Cloud-Code-AI/217-auto-select-default-configuration-while-create-app
added option to skip the configuration part
2 parents a329244 + 1d26833 commit 3eb3e2c

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

packages/create-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-akiradocs",
3-
"version": "1.0.47",
3+
"version": "1.0.48",
44
"description": "Create Akira Docs documentation sites with one command",
55
"main": "./dist/index.js",
66
"type": "module",

packages/create-app/src/index.ts

+30-9
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,37 @@ async function main() {
173173

174174
cli
175175
.command('[directory]', 'Create a new Akira Docs site')
176-
.action(async (directory: string = '.') => {
176+
.option('--yes', 'Skip prompts and use default values')
177+
.action(async (directory: string = '.', options: { yes?: boolean }) => {
177178
try {
178-
const editorResponse = await enquirer.prompt<{ includeEditor: boolean }>({
179-
type: 'confirm',
180-
name: 'includeEditor',
181-
message: 'Would you like to include the local editor? (Recommended for development)',
182-
initial: true,
183-
});
184-
185-
const configAnswers = await promptConfigQuestions();
179+
let editorResponse;
180+
let configAnswers;
181+
182+
if (options.yes) {
183+
// Use default values without prompting
184+
editorResponse = { includeEditor: true };
185+
configAnswers = {
186+
siteTitle: 'My Documentation',
187+
siteDescription: 'Documentation powered by Akira Docs',
188+
companyName: 'My Company',
189+
githubUrl: '',
190+
twitterUrl: '',
191+
linkedinUrl: '',
192+
enableAnalytics: false,
193+
googleAnalyticsId: '',
194+
enableAutoTranslate: false
195+
};
196+
} else {
197+
// Existing prompt flow
198+
editorResponse = await enquirer.prompt<{ includeEditor: boolean }>({
199+
type: 'confirm',
200+
name: 'includeEditor',
201+
message: 'Would you like to include the local editor? (Recommended for development)',
202+
initial: true,
203+
});
204+
205+
configAnswers = await promptConfigQuestions();
206+
}
186207

187208
const spinner = ora('Creating project...').start();
188209

0 commit comments

Comments
 (0)