mirror of
https://github.com/tj/git-extras.git
synced 2026-09-15 09:56:19 -04:00
Merge pull request #122 from jespino/git-effort-with-dash
Fixed 2 bashism and now works on bash and dash
This commit is contained in:
commit
834a43c1bb
|
|
@ -73,8 +73,9 @@ effort() {
|
|||
len=${#file}
|
||||
dot="."
|
||||
f_dot=$file
|
||||
for ((i=0; i < 45-$len ;i++)); do
|
||||
i=0 ; while test $i -lt $((45-$len)) ; do
|
||||
f_dot=$f_dot$dot
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
printf " \033[${color}m%s %-10d" $f_dot $commits
|
||||
|
|
@ -116,7 +117,11 @@ fi
|
|||
|
||||
# [file ...]
|
||||
|
||||
files=${@-`git ls-files`}
|
||||
if test $# -ge 1; then
|
||||
files=$@
|
||||
else
|
||||
files=`git ls-files`
|
||||
fi
|
||||
|
||||
# hide cursor
|
||||
|
||||
|
|
@ -129,4 +134,4 @@ heading
|
|||
effort $files | tee $tmp && sort_effort
|
||||
echo
|
||||
|
||||
show_cursor
|
||||
show_cursor
|
||||
|
|
|
|||
Loading…
Reference in a new issue