diff options
Diffstat (limited to 'packages/create-astro/src/config.ts')
-rw-r--r-- | packages/create-astro/src/config.ts | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/packages/create-astro/src/config.ts b/packages/create-astro/src/config.ts index 3d3c07912..8216fd1ab 100644 --- a/packages/create-astro/src/config.ts +++ b/packages/create-astro/src/config.ts @@ -1,49 +1,49 @@ import type * as arg from 'arg'; export interface ARG { - type: any; - description: string; - enum?: string[]; - alias?: string; + type: any; + description: string; + enum?: string[]; + alias?: string; } export const ARGS: Record<string, ARG> = { - 'template': { - type: String, - description: 'specifies template to use' - }, - 'use': { - type: String, - enum: ['npm', 'yarn'], - description: 'specifies package manager to use' - }, - 'run': { - type: Boolean, - description: 'should dependencies be installed automatically?' - }, - 'force': { - type: Boolean, - alias: 'f', - description: 'should existing files be overwritten?' - }, - 'version': { - type: Boolean, - alias: 'v', - description: 'prints current version' - }, - 'help': { - type: Boolean, - alias: 'h', - description: 'prints this message' - } -} + template: { + type: String, + description: 'specifies template to use', + }, + use: { + type: String, + enum: ['npm', 'yarn'], + description: 'specifies package manager to use', + }, + run: { + type: Boolean, + description: 'should dependencies be installed automatically?', + }, + force: { + type: Boolean, + alias: 'f', + description: 'should existing files be overwritten?', + }, + version: { + type: Boolean, + alias: 'v', + description: 'prints current version', + }, + help: { + type: Boolean, + alias: 'h', + description: 'prints this message', + }, +}; export const args = Object.entries(ARGS).reduce((acc, [name, info]) => { - const key = `--${name}`; - const spec = { ...acc, [key]: info.type }; + const key = `--${name}`; + const spec = { ...acc, [key]: info.type }; - if (info.alias) { - spec[`-${info.alias}`] = key; - } - return spec + if (info.alias) { + spec[`-${info.alias}`] = key; + } + return spec; }, {} as arg.Spec); |