add sourcing after update

This commit is contained in:
csimonis 2024-09-06 08:31:54 +02:00
parent 7c6ca9dc76
commit 18728ab309

View File

@ -4,13 +4,16 @@ cd ~/.dotfiles
echo "Checking for dotfile updates..." echo "Checking for dotfile updates..."
git fetch git fetch
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ] if [ $(git rev-parse HEAD) == $(git rev-parse @{u}) ]
then then
if [ "$1" == -y ] if [ "$1" == -y ]
then then
echo "Updating..." echo "Updating..."
git pull >> /dev/null git pull >> /dev/null
echo "Updated successfully" echo "Updated successfully"
echo "Sourcing new changes..."
source ./source
echo "Sourced new changes successfully"
else else
read -p "Dotfiles can be updated. Do you want to proceed? (y/n) " choice read -p "Dotfiles can be updated. Do you want to proceed? (y/n) " choice
if [ "$choice" = "y" ] if [ "$choice" = "y" ]
@ -18,8 +21,11 @@ then
echo "Updating..." echo "Updating..."
git pull >> /dev/null git pull >> /dev/null
echo "Updated successfully" echo "Updated successfully"
echo "Sourcing new changes..."
source ./source
echo "Sourced new changes successfully"
fi fi
fi fi
else else
echo "Dotfiles are up-to-date" echo "Dotfiles are up-to-date"
fi fi