@@ -37,7 +37,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
3737
3838# Enable autocompletion for git. Should use git-completion.zsh, but it seems problematic on mac
3939autoload -Uz compinit && compinit
40- source "$DIR/git-completion.bash"
40+ if [ -f "$DIR/git-completion.bash" ]; then
41+ source "$DIR/git-completion.bash"
42+ fi
4143
4244# Similarly for gcloud, if available
4345if ! which gcloud >/dev/null; then
@@ -52,19 +54,21 @@ if [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
5254 alias brew86="arch -x86_64 /usr/local/bin/brew $@"
5355fi
5456
55- # Setting this allows us to store ssh-keys in the keychain without generating
56- # a warning. See ssh-add man page.
57- export APPLE_SSH_ADD_BEHAVIOR=macos
57+ # macOS only: Setting this allows us to store ssh-keys in the keychain without
58+ # generating a warning. See ssh-add man page.
59+ if [ "$(uname -s)" = "Darwin" ]; then
60+ export APPLE_SSH_ADD_BEHAVIOR=macos
5861
59- # Add ssh keys stored in the keychain to the ssh-agent
60- # Note: IF you have an identity in ~/.ssh and DO NOT have a passphrase already
61- # in the keychain, you will be prompted for a passphrase. This is because
62- # ssh-add will try to add the key to the agent, and will prompt for a
63- # passphrase if it doesn't have one in the keychain.
64- # If you have a passphrase in the keychain, you will not be prompted.
65- # If you don't have an identity in ~/.ssh, you will not be prompted.
66- # If you have an identity in ~/.ssh and DO have a passphrase in the keychain,
67- # you will not be prompted.
68- # (Being prompted should NOT happen if you ran ssh-add -K when you first
69- # created the key.)
70- ssh-add -K
62+ # Add ssh keys stored in the keychain to the ssh-agent
63+ # Note: IF you have an identity in ~/.ssh and DO NOT have a passphrase already
64+ # in the keychain, you will be prompted for a passphrase. This is because
65+ # ssh-add will try to add the key to the agent, and will prompt for a
66+ # passphrase if it doesn't have one in the keychain.
67+ # If you have a passphrase in the keychain, you will not be prompted.
68+ # If you don't have an identity in ~/.ssh, you will not be prompted.
69+ # If you have an identity in ~/.ssh and DO have a passphrase in the keychain,
70+ # you will not be prompted.
71+ # (Being prompted should NOT happen if you ran ssh-add -K when you first
72+ # created the key.)
73+ ssh-add -K
74+ fi
0 commit comments