From 6aed1b42ae395fe6c8a1e42b64652f287ed60d58 Mon Sep 17 00:00:00 2001 From: Douglas <32344964+NotTheDr01ds@users.noreply.github.com> Date: Mon, 24 Mar 2025 08:27:02 -0400 Subject: [PATCH] Add current exe directory to default `$NU_PLUGIN_DIRS` (#15380) Quality-of-life improvement - Since core plugins are installed into the same directory as the Nushell binary, this simply adds that directory to the default `$NU_PLUGIN_DIRS`. User-facing changes: The default directory for core plugins is automatically added to the `$NU.PLUGIN_DIRS` with no user action necessary. Uses can immediately, out-of-the-box: ```nushell plugin add nu_plugin_polars plugin use polars ``` --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index f514eb47d0..bdebc876f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -167,9 +167,10 @@ fn main() -> Result<()> { ); working_set.set_variable_const_val( var_id, - Value::test_list(vec![Value::test_string( - default_nu_plugin_dirs_path.to_string_lossy(), - )]), + Value::test_list(vec![ + Value::test_string(default_nu_plugin_dirs_path.to_string_lossy()), + Value::test_string(current_exe_directory().to_string_lossy()), + ]), ); engine_state.merge_delta(working_set.render())?; // End: Default NU_LIB_DIRS, NU_PLUGIN_DIRS