Skip to content

Add support for an --outDir CLI flag to astro build#8808

Merged
delucis merged 5 commits intomainfrom
chris/cli-args
Oct 11, 2023
Merged

Add support for an --outDir CLI flag to astro build#8808
delucis merged 5 commits intomainfrom
chris/cli-args

Conversation

@delucis
Copy link
Member

@delucis delucis commented Oct 11, 2023

Changes

  • Passes the value of an --outDir CLI flag through to Astro config, so you can set the build output directory from the command line:

    astro build --outDir ./build
  • I also took a look through the other config options that aren’t currently available as CLI flags. Only srcDir and publicDir felt like potential candidates, but those also both feel like fairly rare options, so chose to only add outDir as part of this PR.

Testing

There don’t seem to be any tests for astro build as far as I can tell? So not sure how to test exactly.

Docs

This will need documenting in the CLI reference docs.
/cc @withastro/maintainers-docs for feedback!

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2023

🦋 Changeset detected

Latest commit: cad1013

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release labels Oct 11, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, thanks for the PR!

natemoo-re and others added 2 commits October 11, 2023 11:10
@delucis delucis merged commit 2993055 into main Oct 11, 2023
@delucis delucis deleted the chris/cli-args branch October 11, 2023 16:26
@astrobot-houston astrobot-houston mentioned this pull request Oct 11, 2023
@ematipico
Copy link
Member

@delucis have you tested this locally at least?

@delucis
Copy link
Member Author

delucis commented Oct 12, 2023

have you tested this locally at least?

Yup! I built and packed astro, installed the tarball in a local project, and ran astro build --outDir out. Behaved as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants