In bash you can use $0 variable to get the location of the current script. How I do the same in Nu? echo $nu doesn't seem to have anything I can use.
$0
echo $nu
As long as you know the name of the file, you can do:
$env.FILE_PWD | path join filename
This will only work if you are executing the file as a script, not sourcing it.
I don't think there's a way to do this yet. I was playing with history | last but it's one off, as you'd expect.
history | last
($nu.config-path | path dirname )
Copyright © 2021 Jogjafile Inc.
As long as you know the name of the file, you can do:
This will only work if you are executing the file as a script, not sourcing it.