You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ -d"$1" ] &&!echo"$PATH"| grep -E -q "(^|:)$newelement($|:)";then
@@ -60,22 +65,22 @@ function gsync() {
60
65
gitBranch=$(git rev-parse --abbrev-ref HEAD)
61
66
if [[ -z"$1" ]];then
62
67
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
64
69
fi
65
70
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)
68
73
69
74
if [[ -z"$hasOrigin"||-z"$hasUpstream" ]];then
70
75
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}"
71
76
return 1
72
77
fi
73
78
74
79
if [[ "$confirm"==""||"$confirm"=="y" ]];then
75
-
git checkout ${gitBranch}
80
+
git checkout "$gitBranch"
76
81
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"
79
84
echo"${COLOR_YELLOW}Complete!${COLOR_RESET}"
80
85
fi
81
86
@@ -298,7 +303,7 @@ function audiosize() {
298
303
299
304
mroot="/Users/andrewray/Music/Extended Mixes"
300
305
# Find all system config files that aren't vim swap files and loop through them
301
-
forfilein`ls "$mroot"`
306
+
forfilein$mroot
302
307
do
303
308
# Show them in a list with a counter
304
309
xx=`expr $xx + 1`
@@ -903,6 +908,19 @@ function ding() {
903
908
afplay /System/Library/Sounds/Glass.aiff
904
909
}
905
910
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
+
906
924
# Grand rounds stuff
907
925
export GR_HOME=${HOME}/dev
908
926
export GR_USERNAME=andrew.ray
@@ -985,18 +1003,6 @@ if [[ -d "${HOME}/c" ]]; then
985
1003
source~/c/c_recent_branches_completer
986
1004
fi
987
1005
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
-
1000
1006
# legacy line? testing removing for new laptop setup and not linux
0 commit comments