Scripts: Add yadm install/upgrade script

Before setting up dotfiles, you can just:

curl https://hedy.tilde.cafe/scripts/install_yadm | bash

^that script is symlink'ed to this
This commit is contained in:
hedy 2022-03-31 18:58:13 +08:00
parent 36c250c93a
commit 08a9d672a8
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 21 additions and 0 deletions

21
dotscripts/install/yadm Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
if command -v yadm &> /dev/null; then
if ! [ -f ~/local/src/yadm/yadm ]; then
echo "Attempted to upgrade yadm, but it was not installed (as a git clone) at ~/local/src/yadm/."
exit
fi
cd ~/local/src/yadm
git pull
cd - > /dev/null
echo "Upgraded yadm!"
echo "> yadm --version"
yadm --version
exit
fi
mkdir -p ~/local/bin
mkdir ~/local/src
git clone https://github.com/TheLocehiliosan/yadm.git ~/local/src/yadm
ln -s ~/local/src/yadm/yadm ~/local/bin/yadm