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
@@ -300,7 +305,7 @@ function audiosize() {
300
305
301
306
mroot="/Users/andrewray/Music/Extended Mixes"
302
307
# Find all system config files that aren't vim swap files and loop through them
303
-
forfilein`ls "$mroot"`
308
+
forfilein$mroot
304
309
do
305
310
# Show them in a list with a counter
306
311
xx=`expr $xx + 1`
@@ -564,6 +569,9 @@ git_purge() {
564
569
git_purge_remote_branches $branch
565
570
}
566
571
572
+
# Replacement for st?
573
+
alias gs="git status --untracked-files=no"
574
+
567
575
#######################################
568
576
# distributed version control section #
569
577
#######################################
@@ -905,6 +913,19 @@ function ding() {
905
913
afplay /System/Library/Sounds/Glass.aiff
906
914
}
907
915
916
+
# Python development, requires pyenv from homebrew
917
+
# Needs to go before GR stuff to
918
+
if [[ $(command -v pyenv) ]];then
919
+
export PYENV_ROOT="$HOME/.pyenv"
920
+
921
+
eval"$(pyenv init -)"
922
+
923
+
# Requires homebrew pyenv-virtualenv
924
+
if [[ -f"${PYENV_ROOT}/shims/virtualenv" ]];then
925
+
eval"$(pyenv virtualenv-init -)"
926
+
fi
927
+
fi
928
+
908
929
# Grand rounds stuff
909
930
export GR_HOME=${HOME}/dev
910
931
export GR_USERNAME=andrew.ray
@@ -987,18 +1008,6 @@ if [[ -d "${HOME}/c" ]]; then
987
1008
source~/c/c_recent_branches_completer
988
1009
fi
989
1010
990
-
# Python development, requires pyenv from homebrew
991
-
if [[ $(command -v pyenv) ]];then
992
-
export PYENV_ROOT="$HOME/.pyenv"
993
-
994
-
eval"$(pyenv init -)"
995
-
996
-
# Requires homebrew pyenv-virtualenv
997
-
if [[ -f"${PYENV_ROOT}/shims/virtualenv" ]];then
998
-
eval"$(pyenv virtualenv-init -)"
999
-
fi
1000
-
fi
1001
-
1002
1011
# legacy line? testing removing for new laptop setup and not linux
1003
1012
# export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
1004
1013
export KEY_SUFFIX=grandrounds.com
@@ -1031,7 +1040,8 @@ function releaseCommits() {
1031
1040
}
1032
1041
1033
1042
functionjgrep() {
1034
-
#{ rake routes >~/dev/rake-routes & } 2>/dev/null
1043
+
# Run this to regenerate
1044
+
# bundle exec rake routes > ~/dev/rake-routes
1035
1045
cat ~/dev/rake-routes | grep "$1"
1036
1046
}
1037
1047
@@ -1138,6 +1148,22 @@ if [ -d "$TRACKER_FLOW_PATH" ]; then
0 commit comments