diff options
author | 2021-07-24 06:35:47 +0300 | |
---|---|---|
committer | 2021-07-23 20:35:47 -0700 | |
commit | c969001a341e0ff17153bff48082883ba9c9cba6 (patch) | |
tree | a4dfc131b319740ba8ad83b40806ce6f61663c75 | |
parent | 96f70c3f9977def0c69c1bd3d56a920004aa3e5a (diff) | |
download | astro-c969001a341e0ff17153bff48082883ba9c9cba6.tar.gz astro-c969001a341e0ff17153bff48082883ba9c9cba6.tar.zst astro-c969001a341e0ff17153bff48082883ba9c9cba6.zip |
Add ability to specify site with command line (#838)
Diffstat (limited to '')
-rw-r--r-- | packages/astro/src/cli.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/astro/src/cli.ts b/packages/astro/src/cli.ts index a1628e2ac..accdb7978 100644 --- a/packages/astro/src/cli.ts +++ b/packages/astro/src/cli.ts @@ -26,6 +26,7 @@ interface CLIState { cmd: cliCommand; options: { projectRoot?: string; + site?: string; sitemap?: boolean; hostname?: string; port?: number; @@ -38,6 +39,7 @@ interface CLIState { function resolveArgs(flags: Arguments): CLIState { const options: CLIState['options'] = { projectRoot: typeof flags.projectRoot === 'string' ? flags.projectRoot : undefined, + site: typeof flags.site === 'string' ? flags.site : undefined, sitemap: typeof flags.sitemap === 'boolean' ? flags.sitemap : undefined, port: typeof flags.port === 'number' ? flags.port : undefined, config: typeof flags.config === 'string' ? flags.config : undefined, @@ -93,6 +95,7 @@ async function printVersion() { /** Merge CLI flags & config options (CLI flags take priority) */ function mergeCLIFlags(astroConfig: AstroConfig, flags: CLIState['options']) { if (typeof flags.sitemap === 'boolean') astroConfig.buildOptions.sitemap = flags.sitemap; + if (typeof flags.site === 'string') astroConfig.buildOptions.site = flags.site; if (typeof flags.port === 'number') astroConfig.devOptions.port = flags.port; if (typeof flags.hostname === 'string') astroConfig.devOptions.hostname = flags.hostname; } |