From 04084f56e8957d30aee3f98e39c7eb4f6e33955f Mon Sep 17 00:00:00 2001 From: Samuel Allan Date: Sun, 21 Jul 2024 17:35:35 +0930 Subject: [PATCH] Fix `mise shell` setting env in nushell 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`. --- src/shell/nushell.rs | 2 +- src/shell/snapshots/mise__shell__nushell__tests__hook_init.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell/nushell.rs b/src/shell/nushell.rs index 5a32641b5..87c32d30e 100644 --- a/src/shell/nushell.rs +++ b/src/shell/nushell.rs @@ -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) {{ diff --git a/src/shell/snapshots/mise__shell__nushell__tests__hook_init.snap b/src/shell/snapshots/mise__shell__nushell__tests__hook_init.snap index b62b4db1c..7ee688d8f 100644 --- a/src/shell/snapshots/mise__shell__nushell__tests__hook_init.snap +++ b/src/shell/snapshots/mise__shell__nushell__tests__hook_init.snap @@ -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) {