diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-11-14 14:36:46 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-11-14 14:36:46 -0200 |
commit | 1340e329768f8f022c6d5cd91e512380d883a5ac (patch) | |
tree | 87c6cde26d85a21d66b8208e42f2bd0aed274eb1 /lib/keyringer/actions/edit | |
parent | 8857d60617c00553aaab7f06153b17699c860e96 (diff) | |
download | keyringer-1340e329768f8f022c6d5cd91e512380d883a5ac.tar.gz keyringer-1340e329768f8f022c6d5cd91e512380d883a5ac.tar.bz2 |
Set file extension for encrypted files
Diffstat (limited to 'lib/keyringer/actions/edit')
-rwxr-xr-x | lib/keyringer/actions/edit | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index 54d0fec..f6477bf 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -16,8 +16,13 @@ keyringer_set_recipients "$FILE" # Warn user echo "Make sure that $BASEDIR is atop of an encrypted volume." +# Get original file EXTENSION +FILENAME="$(basename "$FILE" .asc)" +FILENAME="$(basename "$FILENAME")" +EXTENSION="${FILENAME##*.}" + # Set a tmp file -keyringer_set_tmpfile edit +keyringer_set_tmpfile $BASENAME.$EXTENSION # Decrypt the information to the file $GPG --yes -o "$TMPWORK" --use-agent -d "$KEYDIR/$FILE" @@ -26,6 +31,7 @@ if [ "$BASENAME" == "edit" ]; then APP="$EDITOR" elif [ "$BASENAME" == "open" ]; then if which xdg-open &> /dev/null; then + # TODO: set TMPWORK depending on the MIME type (`file -i` or `xdg-mime query filetype`) APP="xdg-open" else echo "You should have xdg-open application to perform this action, aborting." |