From: PHO Date: Tue, 1 Oct 2013 04:25:42 +0000 (+0900) Subject: tools/export.pl X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=44af120e0a1e42d78ac9db4efcaf384b1197eab0;p=sugar.git tools/export.pl --- diff --git a/tools/export.pl b/tools/export.pl index 46f50c0..960a9ba 100644 --- a/tools/export.pl +++ b/tools/export.pl @@ -4,8 +4,9 @@ use Smart::Comments; use lib 'tools'; require 'utils.pl'; use File::Spec; -use File::Compare; -use File::Copy; +use File::Compare qw(compare); +use File::Copy qw(copy); +use File::Path qw(mkpath); sub main { while (defined(my $arg = <>)) { @@ -31,6 +32,9 @@ sub main { } else { print "Copying $saved to $abs...\n"; + my @path = File::Spec->splitdir($abs); + pop @path; + mkpath(File::Spec->catdir(@path)); copy($saved, $abs) or die $!; } }