Skip to content

Commit

Permalink
Fixing self-cleanup #3
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Jan 14, 2016
1 parent 9c7e928 commit 0357f75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Catmandu/Exporter/BagIt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ sub add {

return 1 if -d $directory && $self->ignore_existing;

Catmandu::Error->throw("$directory exists") if -d $directory && ! $self->overwrite;
Catmandu::Error->throw("$directory exists") if -d $directory && ! $self->overwrite;

my $bagit = defined($self->user_agent) ?
Catmandu::BagIt->new(user_agent => $self->user_agent) :
Expand All @@ -130,7 +130,7 @@ sub add {

mkpath("$directory/data") unless -d "$directory/data";

my ($fh, $filename) = tempfile();
my ($fh, $filename) = tempfile(UNLINK => 1);

# For now using a simplistic mirror operation
my $response = $bagit->_http_client->mirror($url,$filename);
Expand All @@ -150,4 +150,4 @@ sub add {

sub commit { 1 }

1;
1;

0 comments on commit 0357f75

Please sign in to comment.