(bash,tmux) check for empty GIT_KEY before running stmux

This commit is contained in:
juancwu 2026-02-04 00:29:25 +00:00
commit adcb62e6cc

View file

@ -238,6 +238,11 @@ parse_git_branch() {
# Starts a new secure session with auto-wipe enabled
stmux() {
if [ -z "$GIT_KEY" ]; then
echo "Missing GIT_KEY environment variable."
return
fi
ssh-agent sh -c "tmux new-session -s secure \
\; set-hook client-detached \"run-shell 'SSH_AUTH_SOCK=\$SSH_AUTH_SOCK ssh-add -D'\" \
\; send-keys \"ssh-add $GIT_KEY\" C-m"