Skip to content

Commit

Permalink
Fix example (further) (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTheDr01ds authored Nov 2, 2024
1 parent 6ba5776 commit 7a7d6da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion book/modules/creating_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,13 @@ As with any command defined without `--env`, commands and other definitions in t

```nu
export def examine-module [] {
let module_dir = if $env.CURRENT_FILE =~ 'mod\.nu$' {
$env.CURRENT_FILE | path dirname
} else {
$env.CURRENT_FILE
}
# Changes the PWD environment variable
cd ($env.CURRENT_FILE | path dirname)
cd $module_dir
ls
}
```
Expand Down

0 comments on commit 7a7d6da

Please sign in to comment.