X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=installation%2Fdownload-mastofe-build.sh;h=ee353c48c1553f5894f1795125a40325ef15706b;hb=2a520ba008f432e7e1fa297954966e0181245f01;hp=ee9e1c21782eae3947f48ebe88c7745e5f3a39f8;hpb=05da5f5cca00c8b061858ff85e4a4640f3d91cb6;p=akkoma
diff --git a/installation/download-mastofe-build.sh b/installation/download-mastofe-build.sh
index ee9e1c217..ee353c48c 100755
--- a/installation/download-mastofe-build.sh
+++ b/installation/download-mastofe-build.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
project_id="74"
project_branch="rebase/glitch-soc"
@@ -9,29 +9,32 @@ static_dir="instance/static"
# project_branch="pleroma"
# static_dir="priv/static"
-if [[ ! -d "${static_dir}" ]]
+if [ ! -d "${static_dir}" ]
then
echo "Error: ${static_dir} directory is missing, are you sure you are running this script at the root of pleromaâs repository?"
exit 1
fi
-last_modified="$(curl -s -I 'https://git.pleroma.social/api/v4/projects/'${project_id}'/jobs/artifacts/'${project_branch}'/download?job=build' | grep '^Last-Modified:' | cut -d: -f2-)"
+last_modified="$(curl --fail -s -I 'https://git.pleroma.social/api/v4/projects/'${project_id}'/jobs/artifacts/'${project_branch}'/download?job=build' | grep '^Last-Modified:' | cut -d: -f2-)"
echo "branch:${project_branch}"
echo "Last-Modified:${last_modified}"
artifact="mastofe.zip"
-if [[ -e mastofe.timestamp ]] && [[ "${last_modified}" != "" ]]
+if [ "${last_modified}x" = "x" ]
then
- if [[ "$(cat mastofe.timestamp)" == "${last_modified}" ]]
- then
- echo "MastoFE is up-to-date, exitingâ¦"
- exit 0
- fi
+ echo "ERROR: Couldn't get the modification date of the latest build archive, maybe it expired, exiting..."
+ exit 1
+fi
+
+if [ -e mastofe.timestamp ] && [ "$(cat mastofe.timestamp)" = "${last_modified}" ]
+then
+ echo "MastoFE is up-to-date, exiting..."
+ exit 0
fi
-curl -c - "https://git.pleroma.social/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=build" -o "${artifact}" || exit
+curl --fail -c - "https://git.pleroma.social/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=build" -o "${artifact}" || exit
# TODO: Update the emoji as well
rm -fr "${static_dir}/sw.js" "${static_dir}/packs" || exit