X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=tools%2Fexport.pl;h=960a9bae9b55dae9c94dd81ea1022db4cc0a47e1;hb=44af120e0a1e42d78ac9db4efcaf384b1197eab0;hp=46f50c03ab0e3710b8b52ee5a4776bebe68269d7;hpb=815862999cc29bb9cbc1ae16836c2b47702676c9;p=sugar.git 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 $!; } }