mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
asdf.sh: support mksh
The mksh shell (and perhaps others too) will not be able to determine a sourced script's path by looking at either `${BASH_SOURCE[0]}` or `$0`. By capturing the value of `$_` as the very first thing the script does, `asdf.sh` can use that as the input for `dirname` in order to determine a value to use for `$ASDF_DIR`. I have tested this change with mksh to confirm that it works, and have also tested it with both bash and zsh to verify that neither of those stop working. This resolves the only compatibility issue I've ran into with asdf, caused by mksh sourcing a script. All subsequent asdf usage involves an asdf executable doing the sourcing, so it's bash to bash at that point.
This commit is contained in:
parent
76410eca46
commit
f8d843926a
Loading…
Reference in New Issue
Block a user