forked from Shinonome/dots-hyprland
Fix and improvement on installation script.
This commit is contained in:
+27
-15
@@ -7,6 +7,7 @@ function v() {
|
|||||||
echo -e "\e[34m[$0]: Next command to be executed:\e[0m"
|
echo -e "\e[34m[$0]: Next command to be executed:\e[0m"
|
||||||
echo -e "\e[32m$@\e[0m"
|
echo -e "\e[32m$@\e[0m"
|
||||||
execute=true
|
execute=true
|
||||||
|
hasfailed=false
|
||||||
if $ask;then
|
if $ask;then
|
||||||
while true;do
|
while true;do
|
||||||
echo -e "\e[34mDo you want to execute the command shown above? \e[0m"
|
echo -e "\e[34mDo you want to execute the command shown above? \e[0m"
|
||||||
@@ -25,7 +26,16 @@ function v() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if $execute;then
|
if $execute;then
|
||||||
"$@"
|
"$@" || hasfailed=true
|
||||||
|
fi
|
||||||
|
if $hasfailed ;then
|
||||||
|
echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. You may need to resolve the problem manually before proceeding.\e[0m"
|
||||||
|
read -p "Ignore the error and continue this script anyway (NOT Recommended)? [y/N]" p
|
||||||
|
case $p in
|
||||||
|
[yY]) echo -e "\e[34mAlright, continue...\e[0m" ;;
|
||||||
|
*) echo -e "\e[34mOK, exiting...\e[0m" ;exit 1 ;;
|
||||||
|
esac
|
||||||
|
else echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" done.\e[0m"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
@@ -80,22 +90,22 @@ v sudo usermod -aG input "$(whoami)"
|
|||||||
printf '\e[36m2. Installing AGS from git repo\e[97m\n'
|
printf '\e[36m2. Installing AGS from git repo\e[97m\n'
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
installags (){
|
install-ags (){
|
||||||
v git clone --recursive https://github.com/Aylur/ags.git|| \
|
mkdir -p $base/ags
|
||||||
if [ -d ags ];then
|
cd $base/ags
|
||||||
printf "\e[36mSeems \"./ags\" already exists.\e[97m\n"
|
try git init -b main
|
||||||
cd ags
|
try git remote add origin https://github.com/Aylur/ags.git
|
||||||
v git pull
|
git pull origin main && git submodule update --init --recursive
|
||||||
else exit 1
|
npm install
|
||||||
fi
|
meson setup build
|
||||||
v npm install
|
meson install -C build
|
||||||
v meson setup build
|
|
||||||
v meson install -C build
|
|
||||||
cd $base
|
cd $base
|
||||||
}
|
}
|
||||||
if command -v ags >/dev/null 2>&1
|
if command -v ags >/dev/null 2>&1;then
|
||||||
then echo -e "\e[34mCommand \"ags\" already exists. Won\'t install ags.\e[0m"
|
echo -e "\e[34mCommand \"ags\" already exists, no need to install.\e[0m"
|
||||||
else installags
|
echo -e "\e[34mYou can reinstall ags in order to update to the latest version anyway.\e[0m"
|
||||||
|
if $ask;then v install-ags;fi
|
||||||
|
else v install-ags
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
@@ -116,6 +126,8 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
test -f ~/.config/hypr/colors.conf || cp ~/.config/hypr/colors_default.conf ~/.config/hypr/colors.conf
|
||||||
|
|
||||||
# some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync,
|
# some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync,
|
||||||
# since the files here come from different places, not only about one program.
|
# since the files here come from different places, not only about one program.
|
||||||
v rsync -av ".local/bin/" "$HOME/.local/bin/"
|
v rsync -av ".local/bin/" "$HOME/.local/bin/"
|
||||||
|
|||||||
Reference in New Issue
Block a user