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
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
continue
fi
@@ -79,30 +79,30 @@ if [ $IS_MAC == 1 ] ; then
brew install wget bash-completion macvim isync
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.name "Paul Walker"
git config --global pull.rebase true
git config --global push.default current
if [ ! -d "$HOME/.rbenv" ] ; then
git clone https://github.com/rbenv/rbenv.git "$HOME/.rbenv"
git clone https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build"
else
echo "Already have $HOME/.rbenv"
git -C ~/.rbenv pull
git -C ~/.rbenv/plugins/ruby-build pull
fi
echo "Getting latest ASDF release"
ASDF_TAG=$(curl -s -L -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/asdf-vm/asdf/releases/latest | grep "tag_name" | sed -e 's/^.*: \"//' | sed -e 's/",$//')
if [ ! -d "$HOME/.asdf" ] ; then
git clone https://github.com/asdf-vm/asdf.git "$HOME/.asdf"
. bashrc.d/asdf.bash
else
echo "Already have $HOME/.asdf"
git -C ~/.asdf pull
fi
echo "Using go to install asdf@${ASDF_TAG}..."
go install github.com/asdf-vm/asdf/cmd/asdf@${ASDF_TAG}
mv -v ~/go/bin/asdf ~/bin/
# 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
echo "Detected macOS, installing extra packages via asdf."
ADD_AND_INSTALL="$ADD_AND_INSTALL git tmux vim"
@@ -111,7 +111,7 @@ fi
for plugin in $ADD_AND_INSTALL ; do
asdf plugin add $plugin && \
asdf install $plugin latest && \
asdf global $plugin latest
asdf set -u $plugin latest
done
unset ADD_AND_INSTALL
@@ -130,7 +130,7 @@ if [ $IS_FREEBSD == 1 ] ; then
fi
# 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
asdf plugin add $plugin
done