-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile.MinGW
44 lines (37 loc) · 1.31 KB
/
.bash_profile.MinGW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
# ~/.bash_profile.MinGW
#
# Executed when logging into MinGW after the generic .bash_profile and
# before any .bashrc or .bash_aliases
#
# Search for an appropriate EDITOR
#
if [ -e "/c/Program Files/Sublime Text 2/sublime_text.exe" ]; then
export EDITOR="/c/Program Files/Sublime Text 2/sublime_text.exe"
elif [ -e "/c/Program Files/Sublime Text 3/sublime_text.exe" ]; then
export EDITOR="/c/Program Files/Sublime Text 3/sublime_text.exe"
fi
# node.js is installed to a weird location on Windows, so bring it in
# here even though it's not on standard Windows paths etc.
if [ -e "/c/dev/nodejs/node.exe" ]; then
export NODE="/c/dev/nodejs/node.exe"
export NODE_VERSION=$("$NODE" --version)
fi
# MinGW cannot communicate with Pageant :(
# So we need to run a separate ssh-agent here
echo "Connecting to ssh-agent"
export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l > /dev/null 2>&1
if [ $? = 2 ]; then
# exit status 2 means cannot connect, ssh-agent not running
echo "No ssh-agent running, starting a new one..."
rm -f /tmp/.ssh-agent-pid $SSH_AUTH_SOCK
eval $(ssh-agent -a $SSH_AUTH_SOCK)
echo $SSH_AGENT_PID > /tmp/.ssh-agent-pid
# Add all keys to the agent
echo
ssh-add ~/.ssh/*_rsa
echo
echo "ssh-agent contains the following keys:"
ssh-add -l || echo "WARNING: No keys found in ssh-agent" 1>&2
fi