Skip to content

Commit

Permalink
Upgrade command should fail if no previuos version number can be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfighter committed Nov 23, 2023
1 parent ad7107b commit 1c545d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/Sympa/CLI/upgrade.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ sub _upgrade {
$options->{from} ||= Sympa::Upgrade::get_previous_version();
$options->{to} ||= Sympa::Constants::VERSION;

if ($options->{from} eq $options->{to}) {
if (!defined $options->{from}) {
$log->syslog('err', 'No previous version specified');
exit 1;
} elsif ($options->{from} eq $options->{to}) {
$log->syslog('notice', 'Current version: %s; no upgrade is required',
$options->{to});
exit 0;
Expand Down

0 comments on commit 1c545d0

Please sign in to comment.