Skip to content

Commit c1d2566

Browse files
committed
wtf
1 parent 4d56750 commit c1d2566

1 file changed

Lines changed: 25 additions & 19 deletions

File tree

.bashrc

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Colors for prompt
24
COLOR_RED=$(tput sgr0 && tput setaf 1)
35
COLOR_GREEN=$(tput sgr0 && tput setaf 2)
@@ -11,6 +13,9 @@ COLOR_LIGHT_RED=$(tput sgr0 && tput bold && tput setaf 1)
1113
COLOR_LIGHT_CYAN=$(tput sgr0 && tput bold && tput setaf 6)
1214
COLOR_RESET=$(tput sgr0)
1315

16+
# shellcheck disable=SC1091
17+
source ~/.iterm2_shell_integration.bash
18+
1419
pathadd() {
1520
newelement=${1%/}
1621
if [ -d "$1" ] && ! echo "$PATH" | grep -E -q "(^|:)$newelement($|:)" ; then
@@ -60,22 +65,22 @@ function gsync() {
6065
gitBranch=$(git rev-parse --abbrev-ref HEAD)
6166
if [[ -z "$1" ]]; then
6267
echo -n "${COLOR_YELLOW}Sync ${COLOR_BLUE}${gitBranch}${COLOR_YELLOW}? (Enter/y to confirm, n to cancel)${COLOR_RESET} "
63-
read confirm
68+
read -r confirm
6469
fi
6570

66-
hasOrigin=`cat .git/config | grep origin`
67-
hasUpstream=`cat .git/config | grep upstream`
71+
hasOrigin=$(grep origin < .git/config)
72+
hasUpstream=$(grep upstream < .git/config)
6873

6974
if [[ -z "$hasOrigin" || -z "$hasUpstream" ]]; then
7075
echo "${COLOR_RED}Error: ${COLOR_PINK}The command syncdev expects an ${COLOR_RED}origin${COLOR_PINK} and ${COLOR_RED}upstream${COLOR_PINK} remote${COLOR_RESET}"
7176
return 1
7277
fi
7378

7479
if [[ "$confirm" == "" || "$confirm" == "y" ]]; then
75-
git checkout ${gitBranch}
80+
git checkout "$gitBranch"
7681
git fetch --all
77-
git reset --hard upstream/${gitBranch}
78-
git push origin ${gitBranch}
82+
git reset --hard "upstream/$gitBranch"
83+
git push origin "$gitBranch"
7984
echo "${COLOR_YELLOW}Complete!${COLOR_RESET}"
8085
fi
8186

@@ -298,7 +303,7 @@ function audiosize() {
298303

299304
mroot="/Users/andrewray/Music/Extended Mixes"
300305
# Find all system config files that aren't vim swap files and loop through them
301-
for file in `ls "$mroot"`
306+
for file in $mroot
302307
do
303308
# Show them in a list with a counter
304309
xx=`expr $xx + 1`
@@ -903,6 +908,19 @@ function ding() {
903908
afplay /System/Library/Sounds/Glass.aiff
904909
}
905910

911+
# Python development, requires pyenv from homebrew
912+
# Needs to go before GR stuff to
913+
if [[ $(command -v pyenv) ]]; then
914+
export PYENV_ROOT="$HOME/.pyenv"
915+
916+
eval "$(pyenv init -)"
917+
918+
# Requires homebrew pyenv-virtualenv
919+
if [[ -f "${PYENV_ROOT}/shims/virtualenv" ]]; then
920+
eval "$(pyenv virtualenv-init -)"
921+
fi
922+
fi
923+
906924
# Grand rounds stuff
907925
export GR_HOME=${HOME}/dev
908926
export GR_USERNAME=andrew.ray
@@ -985,18 +1003,6 @@ if [[ -d "${HOME}/c" ]]; then
9851003
source ~/c/c_recent_branches_completer
9861004
fi
9871005

988-
# Python development, requires pyenv from homebrew
989-
if [[ $(command -v pyenv) ]]; then
990-
export PYENV_ROOT="$HOME/.pyenv"
991-
992-
eval "$(pyenv init -)"
993-
994-
# Requires homebrew pyenv-virtualenv
995-
if [[ -f "${PYENV_ROOT}/shims/virtualenv" ]]; then
996-
eval "$(pyenv virtualenv-init -)"
997-
fi
998-
fi
999-
10001006
# legacy line? testing removing for new laptop setup and not linux
10011007
# export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
10021008
export KEY_SUFFIX=grandrounds.com

0 commit comments

Comments
 (0)