[feature] add asdf setup script
This commit is contained in:
parent
b9ea068827
commit
041e4b5fc5
14
cli/asdf.sh
Executable file
14
cli/asdf.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
DIR=$(dirname "$(readlink -f "$0")")
|
||||
. "$DIR/../env.sh"
|
||||
|
||||
# install asdf, a multi-lang version manager
|
||||
if ! has_cmd "asdf"; then
|
||||
git_clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
|
||||
mkdir -p ~/.config/fish/completions; and ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
|
||||
asdf plugin add nodejs
|
||||
asdf install nodejs latest
|
||||
asdf global nodejs latest
|
||||
fi
|
|
@ -60,6 +60,7 @@ if status is-interactive
|
|||
append_paths ~/go/bin ~/bin ~/.local/bin ~/.yarn/bin ~/dotfiles/bin ~/dotfiles/devops/bin
|
||||
source_files /usr/share/autojump/autojump.fish /usr/local/share/autojump/autojump.fish \
|
||||
~/.jabba/jabba.fish \
|
||||
~/.asdf/asdf.fish \
|
||||
~/.profile.fish
|
||||
|
||||
# === auto cd into last activated directory
|
||||
|
|
4
env.sh
4
env.sh
|
@ -44,9 +44,9 @@ git_clone() {
|
|||
mkdir -p "$(dirname "$2")"
|
||||
[ -d "$2" ] && return
|
||||
if echo "$1" | grep -qF 'github.com'; then
|
||||
HTTPS_PROXY=$GITHUB_PROXY git clone --depth 1 "$1" "$2"
|
||||
HTTPS_PROXY=$GITHUB_PROXY git clone --depth 1 "$@"
|
||||
else
|
||||
git clone --depth 1 "$1" "$2"
|
||||
git clone --depth 1 "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user