Skip to content

Commit

Permalink
chore: sort up path registration
Browse files Browse the repository at this point in the history
  • Loading branch information
nokazn committed Jul 9, 2024
1 parent 06d839a commit 84b57e3
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions unix/.path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,6 @@ if [[ -d "$HOME/.local/bin" ]]; then
_register_forward_if_not "$HOME/.local/bin"
fi

# anyenv
if [[ -d "$HOME/.anyenv" ]]; then
if _is_unregistered_path "$HOME/.anyenv/bin"; then
PATH="$HOME/.anyenv/bin:$PATH"
# anyenv コマンドが存在する場合
if type "anyenv" >/dev/null 2>&1; then
eval "$(anyenv init -)"
fi
fi
# `~/.anyenv/envs` 配下の `bin` と `shims` ディレクトリをパスとして登録
find ~/.anyenv/envs -mindepth 1 -maxdepth 1 -type d | while read -r dir; do
_register_forward_if_not "${dir}/bin"
_register_forward_if_not "${dir}/shims"
done
fi

# asdf installed byu Nix
if [[ -d "$HOME/.nix-profile/share/asdf-vm" ]]; then
_apply_profiles "$HOME/.nix-profile/share/asdf-vm/" -type f
fi
if [[ -f "/etc/profiles/per-user/$USER/etc/profile.d/asdf-prepare.sh" ]]; then
source "/etc/profiles/per-user/$USER/etc/profile.d/asdf-prepare.sh"
fi

# mise
if [[ -f "$HOME/.local/bin/mise" ]]; then
_start_mise
fi

# proto
if [[ -d "$HOME/.proto" ]]; then
export PROTO_HOME="$HOME/.proto"
_register_forward "${PROTO_HOME}/bin"
_register_forward "${PROTO_HOME}/shims"
fi

# # Go
if command -v go >/dev/null; then
_goBinDir="$(go env GOBIN)"
Expand Down Expand Up @@ -189,6 +153,42 @@ if [[ -d "/etc/profiles/per-user/$USER/bin" ]]; then
_register_forward "/etc/profiles/per-user/$USER/bin"
fi

# anyenv
if [[ -d "$HOME/.anyenv" ]]; then
if _is_unregistered_path "$HOME/.anyenv/bin"; then
PATH="$HOME/.anyenv/bin:$PATH"
# anyenv コマンドが存在する場合
if type "anyenv" >/dev/null 2>&1; then
eval "$(anyenv init -)"
fi
fi
# `~/.anyenv/envs` 配下の `bin` と `shims` ディレクトリをパスとして登録
find ~/.anyenv/envs -mindepth 1 -maxdepth 1 -type d | while read -r dir; do
_register_forward_if_not "${dir}/bin"
_register_forward_if_not "${dir}/shims"
done
fi

# asdf installed byu Nix
if [[ -d "$HOME/.nix-profile/share/asdf-vm" ]]; then
_apply_profiles "$HOME/.nix-profile/share/asdf-vm/" -type f
fi
if [[ -f "/etc/profiles/per-user/$USER/etc/profile.d/asdf-prepare.sh" ]]; then
source "/etc/profiles/per-user/$USER/etc/profile.d/asdf-prepare.sh"
fi

# mise
if [[ -f "$HOME/.local/bin/mise" ]]; then
_start_mise
fi

# proto
if [[ -d "$HOME/.proto" ]]; then
export PROTO_HOME="$HOME/.proto"
_register_forward "${PROTO_HOME}/bin"
_register_forward "${PROTO_HOME}/shims"
fi

# if command -v salias >/dev/null; then
# source <(salias --init)
# fi
Expand Down

0 comments on commit 84b57e3

Please sign in to comment.