chore(gnome-extensions): Add check test for connection to the website before performing other steps

Makes it clearer to the user when error is website related
This commit is contained in:
fiftydinar 2024-07-25 16:37:57 +02:00 committed by GitHub
parent 8e70bb07d5
commit dbc886527f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,6 +17,17 @@ if ! command -v gnome-shell &> /dev/null; then
exit 1
fi
echo "Testing connection with https://extensions.gnome.org/..."
if ! curl --output /dev/null --silent --head --fail "https://extensions.gnome.org/"; then
echo "ERROR: Connection unsuccessful."
echo " This usually happens when https://extensions.gnome.org/ website is down."
echo " Please try again later (or disable the module temporarily)"
exit 1
else
echo "Connection successful, proceeding.
fi
GNOME_VER=$(gnome-shell --version | sed 's/[^0-9]*\([0-9]*\).*/\1/')
echo "Gnome version: ${GNOME_VER}"
LEGACY=false