diff --git a/mod.nu b/mod.nu index 3fcf17e..fde917c 100644 --- a/mod.nu +++ b/mod.nu @@ -3,8 +3,6 @@ const template: path = path self ./template.nu -let nu_lib_dir = $NU_LIB_DIRS | first - export def install [ src: path # Module source path prefix?: path = ~/.local # installation prefix @@ -36,6 +34,7 @@ export def install [ cp -r $src $installed_mod_path if $install_module { + let nu_lib_dir = $NU_LIB_DIRS | first if $force {rm -f ($nu_lib_dir | path join $mod_name)} ln -s $installed_mod_path $nu_lib_dir } @@ -67,6 +66,7 @@ export def uninstall [ rm -f $installed_bin_path if $remove_module { + let nu_lib_dir = $NU_LIB_DIRS | first rm -f ($nu_lib_dir | path join $mod_name) } }