Skip to content
Snippets Groups Projects

switch-branch: prevent downgrades

Merged Josef Schlehofer requested to merge feature/switch-branch-error into master
All threads resolved!
@@ -363,9 +363,9 @@ if [ "$force" != "y" ]; then
if [ "$(printf "%s\n%s" "$target_version" "$CUR_VERSION" | sort -V | head -1)" != "$CUR_VERSION" ]; then
cat <<-EOF
$CUR_VERSION -> $target_version
You are attemping to do downgrade while only upgrades are tested.
You are attempting to do downgrade while only upgrades are supported.
Downgrade can cause unexpected issues because of migration steps performed on upgrade.
You can use schnapps to rollback to previous version or perform factory reset.
You can use schnapps to rollback to a previous version or perform a factory reset.
EOF
exit 1
fi