]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Ensure destination path exists at mv action
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 29 Nov 2015 14:34:06 +0000 (12:34 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 29 Nov 2015 14:34:06 +0000 (12:34 -0200)
lib/keyringer/actions/mv

index 2324145e6dabeb133ae9f7056e1a49f464248866..e31eb8503c581aad29854b9f0d862c6c96b813d9 100755 (executable)
@@ -24,5 +24,8 @@ if ! echo "$ORIG" | grep -q '*' && [ ! -e "$KEYDIR/$RELATIVE_PATH/$ORIG" ]; then
   exit 1
 fi
 
+# Ensure destination path exists
+mkdir -p "`dirname $KEYDIR/$RELATIVE_PATH/$DEST`"
+
 # Run move command
 keyringer_exec git "$BASEDIR" mv "keys/$RELATIVE_PATH/$ORIG" "keys/$FILE"