Skip to content

Commit

Permalink
Fix mise shell setting env in nushell
Browse files Browse the repository at this point in the history
Currently `mise shell` doesn't have an effect in latest nushell.
Functions in nushell that want to export environment variables
must use the `--env` flag in the function definition.

This flag was used on other functions in mise.nu as required
(eg. update-env), however it seems that this flag is also required
on the `main` function that manages updating the env for `mise shell`.
  • Loading branch information
samuelallan72 committed Jul 21, 2024
1 parent b9bc7df commit 04084f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shell/nushell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Shell for Nushell {
$in | lines | parse "{{op}},{{name}},{{value}}"
}}
export def --wrapped main [command?: string, --help, ...rest: string] {{
export def --env --wrapped main [command?: string, --help, ...rest: string] {{
let commands = ["shell", "deactivate"]
if ($command == null) {{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def "parse vars" [] {
$in | lines | parse "{op},{name},{value}"
}

export def --wrapped main [command?: string, --help, ...rest: string] {
export def --env --wrapped main [command?: string, --help, ...rest: string] {
let commands = ["shell", "deactivate"]

if ($command == null) {
Expand Down

0 comments on commit 04084f5

Please sign in to comment.