Remove dependency on seq

seq is unfortunately not available on OSX. Brackets appear to be fully
shell- and platform-independent.
This commit is contained in:
Andrew Lorente
2011-10-20 13:47:19 -07:00
parent 99e4e9dcda
commit cb8a3a6121
2 changed files with 2 additions and 4 deletions

View File

@@ -103,9 +103,7 @@ git_expand_args() {
if [[ "$arg" =~ ^[0-9]+$ ]] ; then # Substitute $e{*} variables for any integers
files="$files $(eval echo \$$git_env_char$arg)"
elif [[ $arg =~ ^[0-9]+\.\.[0-9]+$ ]]; then # Expand ranges into $e{*} variables
for i in $(seq $(echo $arg | tr ".." " ")); do
files="$files $(eval echo \$$git_env_char$i)"
done
files="$files $(eval echo \$$git_env_char{$arg})"
else # Otherwise, treat $arg as a normal string.
# If arg contains any spaces, (re)wrap it in double quotes
if echo $arg | grep -q " "; then arg="\"$arg\""; fi