File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,19 @@ def update():
2525 existing_version = version .parse (existing_version_str )
2626 requested_version = version .parse (requested_version_str )
2727
28- if not args .force :
28+ force_downgrade = False
29+ if args .noninteractive :
30+ # Use the --force flag to decide if downgrades are allowed
31+ force_downgrade = args .force
32+ else :
33+ # Ask the user if downgrades should be allowed
34+ if existing_version >= requested_version :
35+ force_downgrade = print_utils .ask_yes_no (
36+ "update.ask-force-downgrade"
37+ )
38+
39+ if not force_downgrade :
40+ # Fail if the requested version is not an upgrade
2941 if existing_version == requested_version :
3042 print_utils .fail_translate (
3143 "update.version-already-installed" ,
Original file line number Diff line number Diff line change 2020 than the currently installed version, BrainFrame:%{existing_version}. We
2121 don't recommend downgrading BrainFrame for data integrity reasons. This
2222 request will be ignored. You can force a downgrade using the --force flag."
23+ ask-force-downgrade : " BrainFrame:%{requested_version} does not appear to
24+ be a newer version then the current version, BrainFrame:%{existing_version}.
25+ Downgrading BrainFrame is not officially supported and may lead to data loss.
26+ Are you sure you want to continue?"
You can’t perform that action at this time.
0 commit comments