fix(rc): Prevent double-sourcing asdf when both native and Nix installs exist
rc.d/asdf tested native (~/.asdf) and Nix-profile asdf independently, so if both were present on a machine, asdf would be sourced twice — duplicate PATH entries and redefined completions/functions. Make the Nix branch an elif so at most one is sourced.
This commit is contained in:
@@ -6,9 +6,7 @@ if [ -f ~/.asdf/asdf.sh ]; then
|
||||
# activate completion
|
||||
source ~/.asdf/completions/asdf.bash
|
||||
|
||||
fi
|
||||
|
||||
if [ -f "${HOME}/.nix-profile/share/asdf-vm/asdf.sh" ]; then
|
||||
elif [ -f "${HOME}/.nix-profile/share/asdf-vm/asdf.sh" ]; then
|
||||
. "${HOME}/.nix-profile/share/asdf-vm/asdf.sh"
|
||||
. "${HOME}/.nix-profile/share/bash-completion/completions/asdf.bash"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user