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(env): Allow exporting env vars as dotenv format #3185

Merged
merged 5 commits into from
Nov 24, 2024

Conversation

miguelmig
Copy link
Contributor

As the title says, this allows exporting currently active environment variables(excluding PATH) in a dotenv format.

src/cli/env.rs Outdated
@@ -34,8 +38,10 @@ impl Env {

if self.json {
self.output_json(&config, ts)
} else {
} else if self.shell.is_some() {
Copy link
Owner

Choose a reason for hiding this comment

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

does this still default to $SHELL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not, will fix that!

@@ -55,6 +61,15 @@ impl Env {
}
Ok(())
}

fn output_dotenv(&self, config: &Config, ts: Toolset) -> Result<()> {
Copy link
Owner

Choose a reason for hiding this comment

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

needs an e2e test

@jdx jdx merged commit 7de9d12 into jdx:main Nov 24, 2024
28 checks passed
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.

2 participants