Updated hyprsolusctl

Allow for update to not check for package updates unless explicitly told. Fixed bugs
This commit is contained in:
Ethan Smith-Coss 2024-10-09 18:43:00 +01:00
parent 9ca1f80ad5
commit 355cf7dc27
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B

View File

@ -59,7 +59,7 @@ info () {
--local) shift ; release=0 ;; --local) shift ; release=0 ;;
--json) shift ; json=0 ;; --json) shift ; json=0 ;;
--) shift ; glow_args="$*" ; break ;; --) shift ; glow_args="$*" ; break ;;
*) echo "$1" *) echo "Ignoring argument $1" ;;
esac esac
done done
@ -83,8 +83,16 @@ info () {
} }
update () { update () {
cd "$HYPRSOLUS_PATH" while test $# -ne 0
do
case $1 in
--ensure-deps-latest) shift ; deps_update=0 ;;
*) echo "Ignoring argument $1" ;;
esac
done
deps_update=${deps_update:-1}
cd "$HYPRSOLUS_PATH"
# Fetch new content from remote # Fetch new content from remote
git fetch --all git fetch --all
git pull origin main git pull origin main
@ -95,7 +103,10 @@ update () {
systemctl --user daemon-reload systemctl --user daemon-reload
echo "(hyprsolus) Updating the dependencies if needed." echo "(hyprsolus) Updating the dependencies if needed."
sudo sh "${HYPRSOLUS_PATH}/requirements.sh" if [[ $deps_update -eq 0 ]]
then
sudo sh "${HYPRSOLUS_PATH}/requirements.sh"
fi
} }
@ -104,6 +115,8 @@ upgrade () {
do do
case $1 in case $1 in
--ensure-integrity) shift ; eopkg_check=0 ;; --ensure-integrity) shift ; eopkg_check=0 ;;
--ensure-deps-latest) shift ; deps_update=0 ;;
*) echo "Ignoring argument $1" ;;
esac esac
done done
@ -129,7 +142,7 @@ upgrade () {
case $1 in case $1 in
check) check ;; check) check ;;
update) update ;; update) shift ; update "$@" ;;
upgrade) shift ; upgrade "$@" ;; upgrade) shift ; upgrade "$@" ;;
info) shift ; info "$@" ;; info) shift ; info "$@" ;;
*) exit 1 ;; *) exit 1 ;;