File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,26 @@ grey()
9797 printf " \e[0;90m%s\e[0m" " $* "
9898}
9999
100+ if ! realpath . > /dev/null 2>&1 ; then
101+ realpath ()
102+ {
103+ local remove
104+ if [[ " $1 " == --relative-to= * ]]; then
105+ remove=" ${1: 14} /"
106+ shift 1
107+ else
108+ remove=" $"
109+ fi
110+ local filename=" $1 "
111+ local dirname=` dirname " $1 " `
112+ local basename=` basename " $1 " `
113+ (
114+ [ " $dirname " ] || dirname=" ."
115+ cd " $dirname " && echo " ` pwd -P` /$basename "
116+ ) | sed -e " s;${remove} ;;g"
117+ }
118+ fi
119+
100120findTests ()
101121{
102122 for loc in " ${testLocations[@]} "
@@ -111,7 +131,11 @@ findTests()
111131 done
112132}
113133
114- longestFilenameLen=` findTests | wc -L`
134+ if wc -L < /dev/null > /dev/null 2>&1 ; then
135+ longestFilenameLen=` findTests | wc -L`
136+ else
137+ longestFilenameLen=` findTests | awk ' {print length}' | sort -rn | head -1`
138+ fi
115139
116140findTests \
117141| (shuf 2> /dev/null || cat) \
You can’t perform that action at this time.
0 commit comments