From: martin f. krafft Date: Thu, 18 Oct 2007 15:30:30 +0000 (+0200) Subject: ensure parent dir exists prior to checkout X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/c9232098307b1ba10076781bfc7794d133c2236e ensure parent dir exists prior to checkout Signed-off-by: martin f. krafft --- diff --git a/mr b/mr index d4c3b25..b2cb388 100755 --- a/mr +++ b/mr @@ -426,7 +426,12 @@ sub action { #{{{ push @skipped, $dir; return; } + $dir=~s/^(.*)\/[^\/]+\/?$/$1/; + if (! -d $dir) { + print "mr $action: creating parent directory $dir\n" if $verbose; + mkdir $dir; + } } elsif ($action eq 'update') { if (! -d $dir) {