Added upgrade implementation. Fixed pathspec.
This commit is contained in:
parent
a7c2136a60
commit
cbf75a8195
24
hyprsolusctl
24
hyprsolusctl
|
|
@ -99,7 +99,7 @@ update () {
|
||||||
|
|
||||||
echo "(hyprsolus) Updating additional scripts if needed."
|
echo "(hyprsolus) Updating additional scripts if needed."
|
||||||
sudo cp -u "${HYPRSOLUS_PATH}/hyprsolusctl" "/usr/local/bin"
|
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
|
systemctl --user daemon-reload
|
||||||
|
|
||||||
echo "(hyprsolus) Updating the dependencies if needed."
|
echo "(hyprsolus) Updating the dependencies if needed."
|
||||||
|
|
@ -115,10 +115,10 @@ 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" ;;
|
*) echo "Ignoring argument $1" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
echo "Upgrading Hyprland and components with hyprsolus."
|
||||||
|
|
||||||
eopkg_check=${eopkg_check:-1}
|
eopkg_check=${eopkg_check:-1}
|
||||||
if [[ $eopkg_check -eq 0 ]]
|
if [[ $eopkg_check -eq 0 ]]
|
||||||
|
|
@ -137,7 +137,25 @@ upgrade () {
|
||||||
echo "ok."
|
echo "ok."
|
||||||
fi
|
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
|
case $1 in
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user