summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-02 11:43:44 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-03-24 14:46:46 -0300
commit2e987d14ca36042fe256702a3f68c491bfe44ac0 (patch)
tree3b2bf9d73e55fc30331d968b5786db4c3509e717 /lib
parentbe12c6d664052258bb15e63d136cc7606971fd7b (diff)
downloadkeyringer-2e987d14ca36042fe256702a3f68c491bfe44ac0.tar.gz
keyringer-2e987d14ca36042fe256702a3f68c491bfe44ac0.tar.bz2
Ensure destination folder exists at 'cp' action
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/cp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/keyringer/actions/cp b/lib/keyringer/actions/cp
index 0629b61..f3ae20c 100755
--- a/lib/keyringer/actions/cp
+++ b/lib/keyringer/actions/cp
@@ -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"