Page MenuHome GnuPG

No OneTemporary

diff --git a/autotests/testenvs/start.sh b/autotests/testenvs/start.sh
index 9948388..a316676 100755
--- a/autotests/testenvs/start.sh
+++ b/autotests/testenvs/start.sh
@@ -1,122 +1,129 @@
#!/usr/bin/env bash
#
# Starts gpgpass and a tmux session with log, gpg and store environments.
#
# Warning: Sets keys globally for tmux:
#
# Alt+# switch to window #
# Alt(+Shift)+Tab switch to next/previous window
# Alt+r reset the testdata (executes `./reset.sh`)
# Alt+q kill the session
#
# Usage: ./start.sh [<env> [<user>]]
# args
testDir="$(dirname "$(readlink -vf "$0")")"
[ ! -d "$testDir/envs" ] && echo "no envs found. run './reset.sh' first." >&2 && exit 1
env="${1:-main}"
[ ! -d "$testDir/envs/$env" ] && echo "env '$env' not found." >&2 && exit 1
user="${2:-alice}"
[ ! -d "$testDir/envs/$env/$user" ] && echo "user '$user' not found in env '$env'." >&2 && exit 1
# paths
utils="$testDir/templates/utils.sh"
prefix="$testDir/envs/$env/$user/prefix.sh"
emtpyStore="/tmp/gpgpass/stores/$env/$user"
certsAll="$testDir/envs/$env/all"
source "$prefix"
userDir="$userDir"
# cwd
cd "$testDir"
# shortcuts
export shortcuts="
Alt + # switch to window #
Alt (+ Shift) + Tab switch to next/previous window
Alt + r reset the testdata (executes './reset.sh')
Alt + q kill the session"
# reset
runReset() {
# reset envs
./reset.sh > /dev/null && echo "reset successful." || exit 1
# restart gpgpass
local session="gpgpass-${GPGPASS_ENV}-${GPGPASS_USER}"
tmux send-keys -t "$session:gpgpass" C-c "; cd .; clear; echo '$shortcuts'; ./gpgpass" C-m
sleep 0.5
# reload working dirs in terminals
for window in $(tmux list-windows -t "$session" -F "#W"); do
[ "$window" = "gpgpass" ] && continue
tmux send-keys -t "$session:$window" C-c
tmux send-keys -t "$session:$window" "cd ." C-m
done
}
export -f runReset
# session
session="gpgpass-$env-$user"
tmux new-session -s "$session" -c "$userDir" -e "GPGPASS_USER=$user" -e "GPGPASS_ENV=$env" -d
tmux set base-index 1
tmux set allow-rename off
tmux set set-titles "on"
tmux set set-titles-string "GpgPass ${env^} ${user^}"
tmux set status-right "#[fg=white,bold] GpgPass "
tmux set status-left "#[bg=grey,fg=black,bold] $user @ $env "
tmux set status-left-length 40
tmux set status-style "bg=blue fg=black"
tmux set status-position "top"
tmux bind-key -n M-q kill-session
tmux bind-key -n M-r run-shell -c "$testDir" -b "runReset"
tmux bind-key -n M-Tab next-window
tmux bind-key -n M-BTab previous-window
for num in $(seq 1 9); do
tmux bind-key -n M-$num select-window -t $num
done
# gpgpass
tmux move-window -t 1
tmux rename-window "gpgpass"
tmux send-keys "clear; echo '$shortcuts'; $userDir/gpgpass" C-m
sleep 0.5 # wait for gpgpass to set envvars
+# user
+tmux new-window -c "$userDir"
+tmux rename-window "user"
+tmux send-keys "clear; \
+ echo; echo \"export GNUPGHOME='$GNUPGHOME'\"; echo 'source $utils'; echo; \
+ export GNUPGHOME='$GNUPGHOME'; source $utils" C-m
+
# stores
for store in user team template empty; do
[ ! -f "$userDir/store-$store.sh" ] && continue
storePath="store-$store"
[ "$store" = "team" ] && storePath="../store-team"
tmux new-window -c "$userDir"
tmux rename-window "store-$store"
tmux send-keys "clear; cd $storePath; echo; source $userDir/store-$store.sh" C-m
done
# gpg user
if [ -d "$GNUPGHOME" ]; then
tmux new-window -c "$GNUPGHOME"
tmux rename-window "gpg-user"
tmux send-keys "clear; \
echo; echo \"export GNUPGHOME='$GNUPGHOME'\"; echo 'source $utils'; echo; \
export GNUPGHOME='$GNUPGHOME'; source $utils" C-m
fi
# gpg all
if [ -d "$certsAll" ]; then
tmux new-window -c "$certsAll"
tmux rename-window "gpg-all"
tmux send-keys "clear; \
echo; echo \"export GNUPGHOME='$certsAll'\"; echo 'source $utils'; \
export GNUPGHOME='$certsAll'; source $utils" C-m
fi
# window options
for window in $(tmux list-windows -F "#W"); do
tmux select-window -t "$window"
tmux set window-status-separator ""
tmux set window-status-current-style "bg=black fg=blue"
tmux set window-status-format " #[fg=white,bold]#I #[fg=black,nobold]#W "
tmux set window-status-current-format " #[fg=white,dim,bold]#I #[fg=blue,nodim,nobold]#W "
done
# attach
tmux select-window -t "gpgpass"
tmux attach -t "$session"

File Metadata

Mime Type
text/x-diff
Expires
Thu, Feb 26, 6:49 PM (14 h, 59 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
20/50/26b50a41d82893cc49aed35c43c1

Event Timeline