Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/shell/test_nushell
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set +e
# use `env` to control the environment variables available to `nu`
# - we need LD_LIBRARY_PATH so that mise can find libbz2.so.1.0
# - we need PATH so that this test can find `nu`
env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" nu --no-config-file --commands "source ${MISE_NUSHELL_INIT}"
env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" nu --no-config-file --commands "use ${MISE_NUSHELL_INIT}"
NUSHELL_EXIT_CODE=${?}

set -e
Expand Down
2 changes: 1 addition & 1 deletion e2e/shell/test_nushell_deactivation
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set +e
# use `env` to control the environment variables available to `nu`
# - we need LD_LIBRARY_PATH so that mise can find libbz2.so.1.0
# - we need PATH so that this test can find `nu`
env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" nu --no-config-file --commands "source ${MISE_NUSHELL_INIT}"
env --ignore-environment LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" PATH="${PATH}" nu --no-config-file --commands "use ${MISE_NUSHELL_INIT}"
NUSHELL_EXIT_CODE=${?}

set -e
Expand Down
5 changes: 1 addition & 4 deletions src/shell/nushell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,11 @@ impl Shell for Nushell {
"#});

let deactivation_ops_csv = &shell::build_deactivation_script(self);
out.push_str(&formatdoc! {r#"
"{deactivation_ops_csv}" | parse vars | update-env
"#});

let inline_prelude = self.format_activate_prelude_inline(&opts.prelude);
out.push_str(&formatdoc! {r#"
export-env {{
{inline_prelude}
"{deactivation_ops_csv}" | parse vars | update-env
$env.MISE_SHELL = "nu"
let mise_hook = {{
condition: {{ "MISE_SHELL" in $env }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: src/shell/nushell.rs
assertion_line: 178
expression: nushell.activate(opts)
---
def "parse vars" [] {
Expand All @@ -20,9 +19,9 @@ def --env "update-env" [] {
}
}
}
"" | parse vars | update-env
export-env {

"" | parse vars | update-env
$env.MISE_SHELL = "nu"
let mise_hook = {
condition: { "MISE_SHELL" in $env }
Expand Down
Loading