Skip to content

Commit

Permalink
ncp-update-nc: Improve output if no new NC version is available
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Knöppler <[email protected]>
  • Loading branch information
theCalcaholic committed Aug 19, 2024
1 parent bf98d0e commit bb98f59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Next
[[ ${EUID} -eq 0 ]] && SUDO="sudo -u www-data"
CURRENT="$(nc_version)"
TARGET_VERSION="$(determine_nc_upgrade_version "${CURRENT?}" "${VER?}")"
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
exit 0
}
[[ -n "$TARGET_VERSION" ]] || {
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
exit 1
Expand Down
1 change: 1 addition & 0 deletions etc/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ function determine_nc_upgrade_version() {

if [[ "${supported_maj}" -le "${current_maj}" ]]
then
echo "$current"
# No update available
return 0
fi
Expand Down

0 comments on commit bb98f59

Please sign in to comment.