From 6de6cebf629a1df4290c8a4518a33ef9c4a82c3f Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Sat, 2 Nov 2024 10:56:16 -0400 Subject: [PATCH] Change env example --- book/modules/creating_modules.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/book/modules/creating_modules.md b/book/modules/creating_modules.md index dbfde9dd878..3475223f6a5 100644 --- a/book/modules/creating_modules.md +++ b/book/modules/creating_modules.md @@ -331,14 +331,9 @@ cd $env.NU_MODULES_DIR As with any command defined without `--env`, commands and other definitions in the module use their own scope for environment. This allows changes to be made internal to the module without them bleeding into the user's scope. Add the following to the bottom of `my-utils/mod.nu`: ```nu -export def examine-module [] { - let module_dir = if $env.CURRENT_FILE =~ 'mod\.nu$' { - $env.CURRENT_FILE | path dirname - } else { - $env.CURRENT_FILE - } +export def examine-config-dir [] { # Changes the PWD environment variable - cd $module_dir + cd $nu.default-config-dir ls } ```