(bash,tmux) check for empty GIT_KEY before running stmux
This commit is contained in:
parent
01fe5cc1b7
commit
adcb62e6cc
1 changed files with 5 additions and 0 deletions
|
|
@ -238,6 +238,11 @@ parse_git_branch() {
|
||||||
|
|
||||||
# Starts a new secure session with auto-wipe enabled
|
# Starts a new secure session with auto-wipe enabled
|
||||||
stmux() {
|
stmux() {
|
||||||
|
if [ -z "$GIT_KEY" ]; then
|
||||||
|
echo "Missing GIT_KEY environment variable."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
ssh-agent sh -c "tmux new-session -s secure \
|
ssh-agent sh -c "tmux new-session -s secure \
|
||||||
\; set-hook client-detached \"run-shell 'SSH_AUTH_SOCK=\$SSH_AUTH_SOCK ssh-add -D'\" \
|
\; set-hook client-detached \"run-shell 'SSH_AUTH_SOCK=\$SSH_AUTH_SOCK ssh-add -D'\" \
|
||||||
\; send-keys \"ssh-add $GIT_KEY\" C-m"
|
\; send-keys \"ssh-add $GIT_KEY\" C-m"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue