Update install script

Install golang and use that to install asdf
Link tmux*.conf
This commit is contained in:
2025-04-23 13:41:03 +01:00
parent 47ced9b09d
commit 6352e78ec0

38
install
View File

@@ -48,7 +48,7 @@ unset COMMANDS MISSING
# RC files # RC files
mkdir -pv bak mkdir -pv bak
for rc in *rc *profile tmux*.conf bashrc.d mutt ; do for rc in *rc *profile tmux*.conf bashrc.d mutt tmux*conf ; do
if [ ! -r $rc ] ; then if [ ! -r $rc ] ; then
continue continue
fi fi
@@ -79,30 +79,30 @@ if [ $IS_MAC == 1 ] ; then
brew install wget bash-completion macvim isync brew install wget bash-completion macvim isync
fi fi
if [ $IS_LINUX == 1 ] ; then
echo "Installing system golang"
sudo apt install golang
else
echo "Installing brew golang"
brew install golang
fi
git config --global user.email "paul@blacksun.org.uk" git config --global user.email "paul@blacksun.org.uk"
git config --global user.name "Paul Walker" git config --global user.name "Paul Walker"
git config --global pull.rebase true git config --global pull.rebase true
git config --global push.default current git config --global push.default current
if [ ! -d "$HOME/.rbenv" ] ; then echo "Getting latest ASDF release"
git clone https://github.com/rbenv/rbenv.git "$HOME/.rbenv" ASDF_TAG=$(curl -s -L -H "Accept: application/vnd.github+json" \
git clone https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build" -H "X-GitHub-Api-Version: 2022-11-28" \
else https://api.github.com/repos/asdf-vm/asdf/releases/latest | grep "tag_name" | sed -e 's/^.*: \"//' | sed -e 's/",$//')
echo "Already have $HOME/.rbenv"
git -C ~/.rbenv pull
git -C ~/.rbenv/plugins/ruby-build pull
fi
if [ ! -d "$HOME/.asdf" ] ; then echo "Using go to install asdf@${ASDF_TAG}..."
git clone https://github.com/asdf-vm/asdf.git "$HOME/.asdf" go install github.com/asdf-vm/asdf/cmd/asdf@${ASDF_TAG}
. bashrc.d/asdf.bash mv -v ~/go/bin/asdf ~/bin/
else
echo "Already have $HOME/.asdf"
git -C ~/.asdf pull
fi
# Add and install these ones. # Add and install these ones.
ADD_AND_INSTALL="golang ripgrep ag fd bat jq nodejs fzf github-cli task ninja meson" ADD_AND_INSTALL="ripgrep fd jq nodejs fzf github-cli ninja meson lazygit"
if [ $IS_MAC == 1 ] ; then if [ $IS_MAC == 1 ] ; then
echo "Detected macOS, installing extra packages via asdf." echo "Detected macOS, installing extra packages via asdf."
ADD_AND_INSTALL="$ADD_AND_INSTALL git tmux vim" ADD_AND_INSTALL="$ADD_AND_INSTALL git tmux vim"
@@ -111,7 +111,7 @@ fi
for plugin in $ADD_AND_INSTALL ; do for plugin in $ADD_AND_INSTALL ; do
asdf plugin add $plugin && \ asdf plugin add $plugin && \
asdf install $plugin latest && \ asdf install $plugin latest && \
asdf global $plugin latest asdf set -u $plugin latest
done done
unset ADD_AND_INSTALL unset ADD_AND_INSTALL
@@ -130,7 +130,7 @@ if [ $IS_FREEBSD == 1 ] ; then
fi fi
# Just add these, for now. # Just add these, for now.
ADD_ONLY="python tmux sbcl opam gohugo erlang elixir clojure" ADD_ONLY="python tmux sbcl gohugo erlang elixir clojure ag task bat"
for plugin in $ADD_ONLY ; do for plugin in $ADD_ONLY ; do
asdf plugin add $plugin asdf plugin add $plugin
done done