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
|
# activate completion
|
||||||
source ~/.asdf/completions/asdf.bash
|
source ~/.asdf/completions/asdf.bash
|
||||||
|
|
||||||
fi
|
elif [ -f "${HOME}/.nix-profile/share/asdf-vm/asdf.sh" ]; then
|
||||||
|
|
||||||
if [ -f "${HOME}/.nix-profile/share/asdf-vm/asdf.sh" ]; then
|
|
||||||
. "${HOME}/.nix-profile/share/asdf-vm/asdf.sh"
|
. "${HOME}/.nix-profile/share/asdf-vm/asdf.sh"
|
||||||
. "${HOME}/.nix-profile/share/bash-completion/completions/asdf.bash"
|
. "${HOME}/.nix-profile/share/bash-completion/completions/asdf.bash"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user