Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Make sure we check the file we're copying exists
Browse files Browse the repository at this point in the history
  • Loading branch information
moollaza committed Oct 27, 2014
1 parent 7788602 commit 368d930
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/App/DuckPAN/Cmd/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ sub run {
foreach my $asset (@assets) {

my $file_name = $asset->{internal};
my $from_file = path(dist_dir('App-DuckPAN'), $file_name);
my $to_file = $cache_path->child($file_name);
# copy all files in /share (dist_dir) into cache, unless they already exist
path(dist_dir('App-DuckPAN'), $file_name)->copy($to_file) unless ($to_file->exists);
if ($from_file->exists){
$from_file->copy($to_file) unless ($to_file->exists);
}

$self->retrieve_and_cache($asset);
}
Expand Down

0 comments on commit 368d930

Please sign in to comment.