dotfiles/update

16 lines
411 B
Plaintext
Raw Normal View History

2024-09-04 15:20:16 +02:00
#!/bin/bash
cd ~/.dotfiles
2024-09-04 15:30:06 +02:00
echo "Checking for dotfile updates..."
2024-09-04 15:20:16 +02:00
git fetch
2024-09-04 15:46:04 +02:00
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ];
2024-09-04 15:20:16 +02:00
then
2024-09-04 15:30:06 +02:00
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 successfully";;
* ) echo "Skipping";;
esac
else
echo "Dotfiles are up-to-date"
2024-09-04 15:20:16 +02:00
fi;