diff options
author | nachoparker <nacho@ownyourbits.com> | 2020-01-19 06:02:57 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2020-01-19 06:02:57 +0300 |
commit | a98baee67f084d7a34213cf15ac24704f6e574e3 (patch) | |
tree | 92df0bbd31a3bd79eb77557f77cf810613b9c110 | |
parent | e0ae40b8dbaeabbbe57fcb85dd8f6975216227e9 (diff) |
update: fix case where there is no current version filev1.20.5
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rwxr-xr-x | run_update_history.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/run_update_history.sh b/run_update_history.sh index d899950b..add3a29c 100755 --- a/run_update_history.sh +++ b/run_update_history.sh @@ -24,7 +24,11 @@ end_of_list=$((len - 1)) # The latest checkpoint is the newer version in updates dir latest_checkpoint=${updates_list[$end_of_list]} latest_checkpoint_version=$( basename "$latest_checkpoint" .sh ) -current_version=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d'v' -f1 ) +if [[ -f /usr/local/etc/ncp-version ]]; then + current_version=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d'v' -f1 ) +else + current_version="v0.0.0" +fi # Compare current version with latest checkpoint # If the current version is more recent than the latest checkpoint there is no need for backward updates |