From: Silvio Rhatto Date: Tue, 2 Sep 2014 14:43:44 +0000 (-0300) Subject: Ensure destination folder exists at 'cp' action X-Git-Tag: 0.3.8^2~8 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=2e987d14ca36042fe256702a3f68c491bfe44ac0;p=keyringer.git Ensure destination folder exists at 'cp' action --- diff --git a/ChangeLog b/ChangeLog index 683c853..c8708e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-09-02 - Silvio Rhatto + + Ensure destination folder exists at 'cp' action + 2014-08-21 - 0.3.7 - Silvio Rhatto Init: just set git user/mail if needed 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"