Automatically create core-cpan-diff cache dir
authorFlorian Ragwitz <rafl@debian.org>
Tue, 11 Sep 2012 14:06:36 +0000 (10:06 -0400)
committerFlorian Ragwitz <rafl@debian.org>
Tue, 11 Sep 2012 14:06:36 +0000 (10:06 -0400)
Porting/core-cpan-diff

index 54110d8..8483e18 100644 (file)
@@ -155,7 +155,9 @@ sub run {
     }
 
     if ( defined $cache_dir ) {
-        die "ERROR: no such directory: '$cache_dir'\n" unless -d $cache_dir;
+        die "ERROR: not a directory: '$cache_dir'\n"
+            if !-d $cache_dir && -e $cache_dir;
+        File::Path::mkpath($cache_dir);
     }
     else {
         $cache_dir = File::Temp::tempdir( CLEANUP => 1 );