Last active
July 10, 2022 19:52
-
-
Save stevenkaras/65c56b86cfc0bcbd79cb0f50d282390a to your computer and use it in GitHub Desktop.
asdf POSIX bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case "$SHELL" in | |
*fish) | |
[ -f "$HOME/.asdf/asdf.fish" ] && . "$HOME/.asdf/asdf.fish" | |
;; | |
*zsh) | |
[ -f "$HOME/.asdf/asdf.sh" ] && . "$HOME/.asdf/asdf.sh" | |
;; | |
*bash) | |
if [ "${BASH:-no}" != no ]; then | |
[ -f "$HOME/.asdf/asdf.sh" ] && . "$HOME/.asdf/asdf.sh" | |
else | |
[ -f "$HOME/.asdf/asdf.posixsh" ] && . "$HOME/.asdf/asdf.posixsh" | |
fi | |
;; | |
*) | |
[ -f "$HOME/.asdf/asdf.posixsh" ] && . "$HOME/.asdf/asdf.posixsh" | |
;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
export ASDF_DIR | |
ASDF_DIR="$HOME/.asdf" | |
[ -d "$ASDF_DIR" ] || echo "$ASDF_DIR is not a directory" | |
ASDF_BIN="${ASDF_DIR}/bin" | |
ASDF_USER_SHIMS="${ASDF_DATA_DIR:-$HOME/.asdf}/shims" | |
# add to front of $PATH | |
PATH="${ASDF_BIN}:$PATH" | |
PATH="${ASDF_USER_SHIMS}:$PATH" | |
# shellcheck source=lib/asdf.sh | |
# Load the asdf wrapper function | |
. "${ASDF_DIR}/lib/asdf.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment