Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataDownloader#1374: Compare to existing version before downloading #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bio/DataDownloader/lib/DataDownloader/Role/Source.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ sub _build_logger {
return make_logger();
}

has compare_to_existing => (
init_arg => 'COMPARE',
is => 'ro',
isa => 'Bool',
lazy_build => 1,
reader => 'compare_to_existing_version',
);

sub _build_compare_to_existing {
my $self = shift;
my $current_dir = $self->get_source_dir->subdir("current");

if ($self->compare_to_existing_version) {
if ($self->is_same_as($current_dir)) {
$self->info("Can't Download data for " . $self->get_title . " because it already exists in the current directory - skipping");
}
}
}

sub log_start {
my $self = shift;
$self->info("Starting data download for " . $self->get_title);
Expand Down