diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-11-14 15:16:01 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-11-14 15:16:01 -0300 |
commit | 2fce48f2a17e502ad5668197dc6f33a6ce7daee0 (patch) | |
tree | fc02cb407f34935c40c4b46528685740f99a9fec /lib | |
parent | 2ca50eab622d4f3b5017a213ab7aa123b4747579 (diff) | |
parent | 7d1c32c22d7ac199797dfdd691264ebd3379a161 (diff) | |
download | keyringer-2fce48f2a17e502ad5668197dc6f33a6ce7daee0.tar.gz keyringer-2fce48f2a17e502ad5668197dc6f33a6ce7daee0.tar.bz2 |
Merge tag 'upstream_keyringer_0.5.5' into debian
Upstream version 0.5.5
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/keyringer/actions/encrypt | 18 | ||||
-rwxr-xr-x | lib/keyringer/actions/git | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt index 11db62c..1256374 100755 --- a/lib/keyringer/actions/encrypt +++ b/lib/keyringer/actions/encrypt @@ -95,9 +95,14 @@ if [ "$UNENCRYPTED_FILE" != "-" ] && [ -d "$UNENCRYPTED_FILE" ]; then # Time to go recursive BASEPATH="`basename $FILE .asc`" FILEPATH="`dirname "$UNENCRYPTED_FILE"`" + + if [ "$FILEPATH" == "." ]; then + FILEPATH="$(cd `dirname "$UNENCRYPTED_FILE"` &> /dev/null & pwd)" + fi + find $UNENCRYPTED_FILE | while read file; do if [ ! -d "$file" ]; then - dir="`dirname "$file" | sed -e "s|^$FILEPATH|$BASEPATH|g"`" + dir="`dirname "$file" | sed -e "s|^$UNENCRYPTED_FILE|$BASEPATH|" -e "s|^$FILEPATH|$BASEPATH|"`" keyringer_get_new_file `basename "$file"` keyringer_encrypt "$dir/$FILE" $file fi @@ -124,5 +129,16 @@ if [ -d "$BASEDIR/.git" ]; then keyringer_exec git "$BASEDIR" add "keys/$FILE" fi +# Optional commit depending on the value of this setting +if [ "$COMMIT_AFTER_ENCRYPT" == "yes" ]; then + FILE="`echo $FILE | sed -e 's|/./||'`" + echo Changes for keys/$FILE | keyringer_exec git "$BASEDIR" commit -F - +fi + +# Optional push depending on the value of this setting +if [ "$PUSH_AFTER_ENCRYPT" == "yes" ]; then + keyringer_exec git "$BASEDIR" push +fi + # Done exit "$?" diff --git a/lib/keyringer/actions/git b/lib/keyringer/actions/git index f2cb684..1c61e4e 100755 --- a/lib/keyringer/actions/git +++ b/lib/keyringer/actions/git @@ -14,5 +14,5 @@ CWD="`pwd`" shift # Run git command -mkdir -p "$BASEDIR" && cd "$BASEDIR" && git $* +mkdir -p "$BASEDIR" && cd "$BASEDIR" && git "$@" cd "$CWD" |