From f8fa5422781b55bef383822e88672394c408e48d Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 28 Aug 2024 10:14:04 +0900 Subject: [PATCH] Add no version or version not found check for install --- install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install.sh b/install.sh index 7d5da33..439a959 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,15 @@ BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/"; # shellcheck source=init.sh . "${BASE_FOLDER}init.sh"; +if [ -z "${1}" ]; then + echo "Please give a Gitea version to upgrade to"; + exit; +fi; +if [ ! -f "${download_folder}gitea-${1}-${arch}" ]; then + echo "Cannot find file: ${download_folder}gitea-${1}-${arch}"; + exit; +fi; + echo -e "Update gitea to ${1} ... "; systemctl stop gitea; cp "${download_folder}gitea-${1}-${arch}" "${target_file}";