]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Ensure destination folder exists at 'cp' action
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 2 Sep 2014 14:43:44 +0000 (11:43 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 24 Mar 2015 17:46:46 +0000 (14:46 -0300)
ChangeLog
lib/keyringer/actions/cp

index 683c8534105e9f0d3292b00b4d15a9e37b7a5d68..c8708e6fcb957c89be3bafa46674842fd7eebf27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-09-02 - Silvio Rhatto <rhatto@riseup.net>
+
+       Ensure destination folder exists at 'cp' action
+
 2014-08-21 - 0.3.7 - Silvio Rhatto <rhatto@riseup.net>
 
        Init: just set git user/mail if needed
index 0629b613978db238f83f7a80cc93180c9545dfb4..f3ae20cb5464e0810522e98ac56f0fd8c3e2ae6a 100755 (executable)
@@ -27,7 +27,10 @@ if ! echo "$ORIG" | grep -q '*' && [ ! -e "$KEYDIR/$RELATIVE_PATH/$ORIG" ]; then
   exit 1
 fi
 
-# Run move command
+# Ensure destination folder exists
+mkdir -p `dirname "$KEYDIR/$FILE"`
+
+# Run copy command
 cd "$KEYDIR" && cp -a "./$RELATIVE_PATH/$ORIG" "./$FILE"
 keyringer_exec git "$BASEDIR" add "keys/$FILE"
 cd "$CWD"