add update.sh

This commit is contained in:
constantin 2024-09-04 15:20:16 +02:00
parent bc720bba0c
commit defde94c71

13
update.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
cd ~/.dotfiles
git fetch
if [ $(git rev-parse HEAD) == $(git rev-parse @{u}) ];
then
read -p "Dotfiles can be updated. Do you want to proceed? (y/n)" choice
case "$choice" in
y|Y ) echo "updating..." && git pull >> /dev/null && echo "updated";;
* ) echo "skipping";;
esac
fi;