source for core
Runs a script file in the current context.
Signature
> source {flags} (filename)
Parameters
filename: The filepath to the script file to source (nullfor no-op).
Input/output types:
| input | output | 
|---|---|
| any | any | 
Examples
Runs foo.nu in the current context
> source foo.nuRuns foo.nu in current context and call the command defined, suppose foo.nu has content: def say-hi [] { echo 'Hi!' }
> source ./foo.nu; say-hiSourcing null is a no-op.
> source nullSource can be used with const variables.
> const file = if $nu.is-interactive { "interactive.nu" } else { null }; source $fileNotes
This command is a parser keyword. For details, check: https://www.nushell.sh/book/thinking_in_nu.html