Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): load env based on foundry profile #3571

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

holic
Copy link
Member

@holic holic commented Feb 5, 2025

closes #3565

I am not in love with this approach because it adds an implicit --profile flag to all our commands, but there's not really another way to do this because

  • we need to load the env files before importing commands (due to how debug and other libs use env on import)
  • to avoid unnecessarily overriding env vars (like ones passed directly into the command), we have to load env files in order of most-specific to least-specific (which means we need to know the value of the --profile flag ahead of time)

I also don't love mucking with process.argv but we only use it in this file and dotenv already mucks with process.env in the same way, so maybe it's fine.

Copy link

changeset-bot bot commented Feb 5, 2025

⚠️ No Changeset found

Latest commit: a7b066a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consider loading .env.$FOUNDRY_PROFILE in deploy
1 participant