Add gum confirm
This commit is contained in:
parent
7707ac4206
commit
162bf3a088
@ -18,14 +18,12 @@ echo -e "${NONE}"
|
|||||||
if [ -d ~/dotfiles ]; then
|
if [ -d ~/dotfiles ]; then
|
||||||
echo "The script has detected an existing dotfiles folder and will try to create a backup into the folder:"
|
echo "The script has detected an existing dotfiles folder and will try to create a backup into the folder:"
|
||||||
echo "~/dotfiles-versions/backups/$datets"
|
echo "~/dotfiles-versions/backups/$datets"
|
||||||
echo ""
|
|
||||||
fi
|
fi
|
||||||
if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then
|
if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then
|
||||||
echo "The script has detected an existing .bashrc file and will try to create a backup to:"
|
echo "The script has detected an existing .bashrc file and will try to create a backup to:"
|
||||||
echo "~/dotfiles-versions/backups/$datets/.bashrc-old"
|
echo "~/dotfiles-versions/backups/$datets/.bashrc-old"
|
||||||
echo ""
|
|
||||||
fi
|
fi
|
||||||
if gum confirm "Do you want to proceed?" ;then
|
if gum confirm "Do you want to create a backup?" ;then
|
||||||
if [ ! -d ~/dotfiles-versions ]; then
|
if [ ! -d ~/dotfiles-versions ]; then
|
||||||
mkdir ~/dotfiles-versions
|
mkdir ~/dotfiles-versions
|
||||||
echo "~/dotfiles-versions created."
|
echo "~/dotfiles-versions created."
|
||||||
|
@ -16,10 +16,7 @@ if [ ! -d ~/wallpaper ]; then
|
|||||||
echo "Do you want to download the wallpapers from repository https://gitlab.com/stephan-raabe/wallpaper/ ?"
|
echo "Do you want to download the wallpapers from repository https://gitlab.com/stephan-raabe/wallpaper/ ?"
|
||||||
echo "If not, the script will install 3 default wallpapers in ~/wallpaper/"
|
echo "If not, the script will install 3 default wallpapers in ~/wallpaper/"
|
||||||
echo ""
|
echo ""
|
||||||
while true; do
|
if gum confirm "Do you want to download the repository?" ;then
|
||||||
read -p "Do you want to download the repository? (Yy/Nn): " yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]* )
|
|
||||||
wget -P ~/Downloads/ https://gitlab.com/stephan-raabe/wallpaper/-/archive/main/wallpaper-main.zip
|
wget -P ~/Downloads/ https://gitlab.com/stephan-raabe/wallpaper/-/archive/main/wallpaper-main.zip
|
||||||
unzip -o ~/Downloads/wallpaper-main.zip -d ~/Downloads/
|
unzip -o ~/Downloads/wallpaper-main.zip -d ~/Downloads/
|
||||||
if [ ! -d ~/wallpaper/ ]; then
|
if [ ! -d ~/wallpaper/ ]; then
|
||||||
@ -27,8 +24,7 @@ while true; do
|
|||||||
fi
|
fi
|
||||||
cp ~/Downloads/wallpaper-main/* ~/wallpaper/
|
cp ~/Downloads/wallpaper-main/* ~/wallpaper/
|
||||||
echo "Wallpapers frpm the repository installed successfully."
|
echo "Wallpapers frpm the repository installed successfully."
|
||||||
break;;
|
else
|
||||||
[Nn]* )
|
|
||||||
if [ -d ~/wallpaper/ ]; then
|
if [ -d ~/wallpaper/ ]; then
|
||||||
echo "wallpaper folder already exists."
|
echo "wallpaper folder already exists."
|
||||||
else
|
else
|
||||||
@ -36,10 +32,7 @@ while true; do
|
|||||||
fi
|
fi
|
||||||
cp wallpapers/* ~/wallpaper
|
cp wallpapers/* ~/wallpaper
|
||||||
echo "Default wallpapers installed successfully."
|
echo "Default wallpapers installed successfully."
|
||||||
break;;
|
fi
|
||||||
* ) echo "Please answer yes or no.";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
echo "~/wallpaper folder already exsits."
|
echo "~/wallpaper folder already exsits."
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user