comparison .bash_overrides @ 412:5bee5c55a7a0

args test + bash overrides hg safety
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 04 Aug 2013 22:59:52 -0700
parents 597455a28c49
children 337984b6af92
comparison
equal deleted inserted replaced
411:9d6e7a471fc7 412:5bee5c55a7a0
95 COMMAND="`which find` -L \"$DIR\" -not -path '*.svn*' $@" 95 COMMAND="`which find` -L \"$DIR\" -not -path '*.svn*' $@"
96 #echo $COMMAND # for debugging 96 #echo $COMMAND # for debugging
97 `which find` -L "$DIR" -not -path '*.svn*' "$@" 97 `which find` -L "$DIR" -not -path '*.svn*' "$@"
98 } 98 }
99 99
100 function hg {
101 if [[ "$(hg root)" == "${HOME}" ]]
102 then
103 if [[ "$*" == st* ]]
104 then
105 command hg st -q
106 return
107 fi
108 if [[ "$*" == res* ]] || [[ "$*" == pu* ]]
109 then
110 echo "Aborting \'hg $*\'; hg root is ${HOME}!"
111 fi
112 fi
113 }
114
100 function lsdiff { 115 function lsdiff {
101 # TODO: extract this general pattern as a bash "decorator" 116 # TODO: extract this general pattern as a bash "decorator"
102 if expr "$1" : 'http[s]\?://.*' &> /dev/null 117 if expr "$1" : 'http[s]\?://.*' &> /dev/null
103 then 118 then
104 curl --location "$1" 2> /dev/null | command lsdiff 119 curl --location "$1" 2> /dev/null | command lsdiff