Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Allow def-env to hide environment variables #921

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

kubouch
Copy link
Contributor

@kubouch kubouch commented Feb 3, 2022

Description

Fixes #907

> let-env FOO = "foo"

> def-env hide-foo [] {
    hide FOO
}

> $env.FOO
# Error, FOO not found.

Tests

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --all --all-features -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo build; cargo test --all --all-features to check that all the tests pass

@kubouch
Copy link
Contributor Author

kubouch commented Feb 3, 2022

Please don't merge, I realized I can just insert callee's stack.env_vars to the caller's stack and not do all this shenanigans.

(I'm not sure how to convert to a draft PR on the phone.)

@sophiajt sophiajt marked this pull request as draft February 4, 2022 00:24
@kubouch kubouch marked this pull request as ready for review February 4, 2022 18:01
@kubouch
Copy link
Contributor Author

kubouch commented Feb 4, 2022

Ah, nevermind, it was actually correct :-D

@kubouch kubouch merged commit fefd5fe into nushell:main Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

let-env works inside a def-env block, but hide does not
1 participant