-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
57 lines (48 loc) · 1.42 KB
/
.bash_profile
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
45
46
47
48
49
50
51
52
53
54
55
56
# Include .bashrc file (if present).
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
# Get Homebrew's directory prefix.
brew_prefix=$(brew --prefix)
# Source bash completion scripts.
if [ -f ${brew_prefix}/etc/bash_completion ]; then
. ${brew_prefix}/etc/bash_completion
fi
# Add Homebrew bins to path.
export PATH="${brew_prefix}/sbin:$PATH"
# Set NVM directory and source its script.
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
# BLT cli function.
function blt() {
if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then
GIT_ROOT=$(git rev-parse --show-cdup)
else
GIT_ROOT="."
fi
if [ -f "$GIT_ROOT/vendor/bin/blt" ]; then
$GIT_ROOT/vendor/bin/blt "$@"
else
echo "You must run this command from within a BLT-generated project repository."
return 1
fi
}
# Check if DevDesktop is running.
if [ ! -z "$(pgrep -x "Acquia Dev Desktop")" ];
then
# If DevDesktop is running, add DevDesktop tools
# (this includes its versions of php and drush).
export PATH="/Applications/DevDesktop/tools:$PATH"
fi
function toolset () {
vstr_regex='[^\.0-9]'
ostr_regex='.*'
bins=('drush' 'brew' 'nvm' 'node' 'vagrant')
for bin in "${bins[@]}"; do
if [ ! -z $(command -v ${bin}) ]; then
echo "${bin}: "$(${bin} --version | sed -e 1s/${vstr_regex}//g -e 2,\$s/${ostr_regex}//g)
else
echo "${bin} could not be found"
fi
done
}