sekrit: don't define a default SEKRIT_GPG_ID

And abort operation if no SEKRIT_GPG_ID is provided.
This commit is contained in:
Lucas 2020-08-26 02:24:01 +00:00
parent 1839a100f6
commit a7c8d5e369
3 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,7 @@
.\" Dedication along with this software. If not, see
.\" <http://creativecommons.org/publicdomain/zero/1.0/>.
.\"
.Dd May 25, 2020
.Dd August 26, 2020
.Dt SEKRIT 1
.Os
.Sh NAME
@ -117,8 +117,9 @@ Defaults to
.Pa ~/keep/sekrit .
.It Ev SEKRIT_GPG_ID
The recipient to whom encrypt the files.
Defaults to
.Ar myself .
Must be set for
.Nm
to work.
.El
.Sh EXIT STATUS
.Ex -std

View File

@ -193,9 +193,10 @@ shift
umask 077
: ${SEKRIT_DIR:=~/keep/sekrit}
: ${SEKRIT_GPG_ID:=myself}
mkdir -p "$SEKRIT_DIR"
[ -n "$SEKRIT_GPG_ID" ] || err "SEKRIT_GPG_ID is empty"
case "$cmd" in
add) sekrit_add "$@" ;;
cp) sekrit_cp "$@" ;;

View File

@ -19,6 +19,9 @@ export EDITOR PAGER VISUAL
GPG_TTY=$(tty)
export GPG_TTY
SEKRIT_GPG_ID=sekrit_key
export SEKRIT_GPG_ID
alias cp="cp -i"
alias l="ls -F"
alias la="ls -aF"