Skip to content

Commit

Permalink
Add support for an --outDir CLI flag to astro build (#8808)
Browse files Browse the repository at this point in the history
* Add support for an `--outDir` CLI flag to `astro build`

* Add changeset

* Update .changeset/eleven-olives-train.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
  • Loading branch information
3 people authored Oct 11, 2023
1 parent c4270e4 commit 2993055
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-olives-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': minor
---

Adds support for an `--outDir` CLI flag to `astro build`
1 change: 1 addition & 0 deletions packages/astro/src/cli/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export async function build({ flags }: BuildOptions) {
tables: {
Flags: [
['--drafts', `Include Markdown draft pages in the build.`],
['--outDir <directory>', `Specify the output directory for the build.`],
['--help (-h)', 'See all available flags.'],
],
},
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/cli/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig {
root: typeof flags.root === 'string' ? flags.root : undefined,
site: typeof flags.site === 'string' ? flags.site : undefined,
base: typeof flags.base === 'string' ? flags.base : undefined,
outDir: typeof flags.outDir === 'string' ? flags.outDir : undefined,
markdown: {
drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined,
},
Expand Down

0 comments on commit 2993055

Please sign in to comment.