1
0
mirror of https://github.com/nushell/nushell.git synced 2025-03-03 09:51:26 +01:00
nushell/tests/shell
Bahex 79f19f2fc7
Enable conditional source and use patterns by allowing null as a no-op module ()
Related:
- 
- 
- 

# Description & User-Facing Changes

This PR allows enables the following uses, which are all no-op.
```nushell
source null
source-env null
use null
overlay use null
```

The motivation for this change is conditional sourcing of files. For
example, with this change `login.nu` may be deprecated and replaced with
the following code in `config.nu`
```nushell
const login_module = if $nu.is-login { "login.nu" } else { null }
source $login_module
```

# Tests + Formatting
I'm hoping for CI to pass 😄

# After Submitting
Add a part about the conditional sourcing pattern to the website.
2025-01-09 06:37:27 -06:00
..
environment Increment SHLVL before run_repl() () 2025-01-03 15:16:57 -06:00
pipeline Add proper config defaults for hooks () 2024-11-14 20:27:26 -08:00
mod.rs Enable conditional source and use patterns by allowing null as a no-op module () 2025-01-09 06:37:27 -06:00
repl.rs Fix merging child stack into parent () 2024-04-06 15:03:22 +00:00