Added upgrade implementation. Fixed pathspec.

This commit is contained in:
Ethan Smith-Coss 2024-11-17 11:07:36 +00:00
parent a7c2136a60
commit cbf75a8195
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B

View File

@ -99,7 +99,7 @@ update () {
echo "(hyprsolus) Updating additional scripts if needed."
sudo cp -u "${HYPRSOLUS_PATH}/hyprsolusctl" "/usr/local/bin"
sudo cp -ru "${HYPRSOLUS_PATH}/systemd" "$HOME/.config/systemd/"
sudo cp -ru "${HYPRSOLUS_PATH}/systemd" "$HOME/.config"
systemctl --user daemon-reload
echo "(hyprsolus) Updating the dependencies if needed."
@ -115,10 +115,10 @@ upgrade () {
do
case $1 in
--ensure-integrity) shift ; eopkg_check=0 ;;
--ensure-deps-latest) shift ; deps_update=0 ;;
*) echo "Ignoring argument $1" ;;
esac
done
echo "Upgrading Hyprland and components with hyprsolus."
eopkg_check=${eopkg_check:-1}
if [[ $eopkg_check -eq 0 ]]
@ -137,7 +137,25 @@ upgrade () {
echo "ok."
fi
# TODO: Implement calls to make build system
# quick check for submodule initialisation
if git -C "$HYPRSOLUS_PATH" submodule status | grep --quiet '^-'
then
if ! git -C "$HYPRSOLUS_PATH" submodule update --init --recursive
then
>&2 echo "[FATAL] Git was not able to initialise submoules."
exit 4
fi
fi
cd "$HYPRSOLUS_PATH"
make clean && make
exit_code=$?
if [[ $exit_code -ne 0 ]]
then
>&2 echo "[FATAL] Something went wrong trying to upgrade. See above."
exit 5
fi
sudo make install
}
case $1 in