Skip to content

Add --unset option to remove environment variables#26

Merged
sorah merged 1 commit intosorah:masterfrom
k0kubun:unset-env
Oct 14, 2021
Merged

Add --unset option to remove environment variables#26
sorah merged 1 commit intosorah:masterfrom
k0kubun:unset-env

Conversation

@k0kubun
Copy link
Copy Markdown
Contributor

@k0kubun k0kubun commented Oct 14, 2021

It seems like envchain currently doesn't provide a way to remove namespaces or environment variables. Sometimes you may be able to set "" as a workaround, but "" vs null matters in some applications.

So I added --unset option to remove environment variables. You can also clean up namespaces you no longer use from envchain --list if you remove all environment variables under a namespace using this feature.

Example

$ ./envchain --set test TEST1 TEST2
test.TEST1: test1
test.TEST2: test2
$ ./envchain --unset test TEST2
$ ./envchain test env | grep TEST
TEST1=test1

@sorah sorah merged commit e5cb16b into sorah:master Oct 14, 2021
@k0kubun k0kubun deleted the unset-env branch October 14, 2021 16:22
@gardar
Copy link
Copy Markdown
Contributor

gardar commented Feb 8, 2022

Might be a good idea to document this option in the readme?

Also perhaps a new release is due since this option only exists on master and not in any release @sorah

sorah added a commit that referenced this pull request Apr 23, 2024
- --help now includes `--list` command
- --unset option is introduced #26
- several bug fixes
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.

3 participants