Hyprland-dotfiles/update.sh

61 lines
1.7 KiB
Bash
Raw Normal View History

2024-02-29 15:46:01 -05:00
#!/bin/bash
2024-03-01 04:47:14 -05:00
# _ _ _ _
# | | | |_ __ __| | __ _| |_ ___
# | | | | '_ \ / _` |/ _` | __/ _ \
# | |_| | |_) | (_| | (_| | || __/
# \___/| .__/ \__,_|\__,_|\__\___|
# |_|
#
2024-02-29 15:46:01 -05:00
clear
sleep 1
figlet "Update"
echo
if gum confirm "Do you want to start the update now?" ;then
# Remove existing download folder
if [ -d $HOME/Downloads/dotfiles ] ;then
rm -rf $HOME/Downloads/dotfiles
fi
if [ -d $HOME/Downloads/dotfiles-main ] ;then
rm -rf $HOME/Downloads/dotfiles-main
fi
if [ -d $HOME/Downloads/dotfiles-dev ] ;then
rm -rf $HOME/Downloads/dotfiles-dev
fi
echo "Please choose between the main-release or the rolling-release:"
version=$(gum choose "main-release" "rolling-release")
if [ "$version" == "main-release" ] ;then
# Download dotfiles zip into ~/Downloads
wget -P ~/Downloads/ https://gitlab.com/stephan-raabe/dotfiles/-/archive/main/dotfiles-main.zip
v="main"
elif [ "$version" == "rolling-release" ] ;then
wget -P ~/Downloads/ https://gitlab.com/stephan-raabe/dotfiles/-/archive/dev/dotfiles-dev.zip
v="dev"
else
exit 130
fi
echo ":: Download complete."
echo ""
# Unzip
unzip -o ~/Downloads/dotfiles-$v.zip -d ~/Downloads/
echo ":: Unzip complete."
cd ~/Downloads/dotfiles-$v/
# Start the installatiom
if gum confirm "Do you want to start the update now?" ;then
2024-03-01 04:47:14 -05:00
echo
2024-03-01 05:32:45 -05:00
echo "Starting the update now..."
2024-02-29 15:46:01 -05:00
sleep 2
cd $HOME/Downloads/dotfiles-$v
./install.sh
elif [ $? -eq 130 ]; then
exit 130
else
echo "Installation canceled."
exit;
fi
elif [ $? -eq 130 ]; then
exit 130
fi