diff --git a/scripts/menu.pl b/scripts/menu.pl index a58af4a..8c1b36f 100644 --- a/scripts/menu.pl +++ b/scripts/menu.pl @@ -43,9 +43,19 @@ my %handlers = ( # Download ran experiments from mars my @dirs = Mars::find_remote_subdirs($remote_builds_dir); + + my @existing = Util::find_subdirs($local_archive_dir); + my @new_dirs; + foreach (@dirs) { + my $dir = $_ =~ s/:/-/gr; + unless ( grep { /$dir/ } @existing ) { + push @new_dirs, $_; + } + } + my @selected_dirs = TUI::select_from_list( "Select Experiments to Download from Mars", - 1, @dirs ); + 1, @new_dirs ); die "No experiment selected" unless @selected_dirs; Mars::download_dir( "$remote_builds_dir/$_", "$local_archive_dir/" . $_ =~ s/:/-/gr )