From b5678dffe262d5812b44ed49493f122c9a367db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 9 Mar 2020 11:47:36 +0100 Subject: [PATCH] Remove temp file only if no upgrade detected --- github/check.nextcloud.update | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/github/check.nextcloud.update b/github/check.nextcloud.update index 0a3db10..2e4c792 100755 --- a/github/check.nextcloud.update +++ b/github/check.nextcloud.update @@ -86,9 +86,6 @@ while IFS= read -r nc_new_version; do touch -- "${nc_new_version_file}" printf '\e[1;35m%-6s\e[m\n' "An upgrade is available for Nextcloud (current : ${nc_current_version}) : ${nc_new_version}." >> "${nc_new_version_file}" printf '\e[1;35m%-6s\e[m\n' "Please also take a look to the CHANGELOG : https://nextcloud.com/changelog/#latest${nc_new_major}" >> "${nc_new_version_file}" - - ### Exit to ensure to keep the file in place - exit 0 ## }}} ## It's an upgrade for a previous major release {{{ else @@ -99,8 +96,11 @@ while IFS= read -r nc_new_version; do # }}} # Same version {{{ else - [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — The current version is up-to-date." - rm -f -- "${nc_new_version_file}" + ## If no previous upgrade was already detected + if [ ! -s "${nc_app_new_version_file}" ]; then + [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — The current version is up-to-date." + rm -f -- "${nc_new_version_file}" + fi fi # }}}