Skip to content

Commit

Permalink
Change env example (nushell#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTheDr01ds authored Nov 2, 2024
1 parent 7a7d6da commit 08bcbf8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions book/modules/creating_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down

0 comments on commit 08bcbf8

Please sign in to comment.