From 2e987d14ca36042fe256702a3f68c491bfe44ac0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 2 Sep 2014 11:43:44 -0300 Subject: Ensure destination folder exists at 'cp' action --- lib/keyringer/actions/cp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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" -- cgit v1.2.3