Skip to content

Commit 3ab0590

Browse files
committed
scripts: dasharo-deploy: fix version comparison in update workflow
Signed-off-by: Daniil Klimuk <[email protected]>
1 parent 98af947 commit 3ab0590

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/dasharo-deploy

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,11 +980,23 @@ update_workflow() {
980980
prepare_env update
981981

982982
print_ok "Current Dasharo version: $DASHARO_VERSION"
983-
print_ok "Latest available Dasharo version: $UPDATE_VERSION"
983+
print_ok "Latest available Dasharo version for your subscribtion: $UPDATE_VERSION"
984+
984985

985986
# TODO: Why do we separate Heads firmware-related code from other code? A
986987
# common way to handle this should be found.
987-
handle_fw_switching $CAN_SWITCH_TO_HEADS
988+
#
989+
# Versions should be compared in case we are not switching to Heads, because
990+
# heads version is not set at this moment, it is being set and compared in
991+
# handle_fw_switching:
992+
if [ "$CAN_SWITCH_TO_HEADS" = "true" ]; then
993+
handle_fw_switching $CAN_SWITCH_TO_HEADS
994+
else
995+
compare_versions $DASHARO_VERSION $UPDATE_VERSION
996+
if [ $? -ne 1 ]; then
997+
error_exit "No update available for your machine"
998+
fi
999+
fi
9881000

9891001
# TODO: It is not a good practice to do some target specific work in the code
9901002
# of a scallable product, this should be handled in a more scallable way:

0 commit comments

Comments
 (0)