Skip to content

Commit

Permalink
Different variant on handling teh regex captures
Browse files Browse the repository at this point in the history
  • Loading branch information
lancew committed Jan 19, 2021
1 parent 9157afa commit ff966fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/vwjl_admin.pm
Expand Up @@ -183,9 +183,9 @@ get '/database' => sub {

my @file_list = $inf->get_migration_files;
$file_list[-1] =~ /^(\d{3})/;
die 'File name did not start with 3 digits' unless $1;

my $file_migration_level = $1;
my $file_migration_level;
$file_migration_level = $1 if $1;

template 'admin/database' => {
users => $users,
Expand All @@ -210,9 +210,8 @@ post '/database' => sub {

for my $file ( sort @migration_files ) {
$file =~ /(\d{3})/;
next unless $1;

my $migration = $1;
my $migration = $1 if $1;

if ( $db_migration_level < $migration ) {

Expand Down

0 comments on commit ff966fd

Please sign in to comment.