From 44af120e0a1e42d78ac9db4efcaf384b1197eab0 Mon Sep 17 00:00:00 2001 From: PHO Date: Tue, 1 Oct 2013 13:25:42 +0900 Subject: [PATCH] tools/export.pl --- tools/export.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 $!; } } -- 2.40.0