File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,14 +14,15 @@ command-list() {
1414 which -a " $1 "
1515}
1616
17- indent () {
18- sed ' s/^/ /'
17+ deduplicate-paths () {
18+ local path
19+ while read -r path; do
20+ readlink -f " $path " || printf " %s\n" " $path "
21+ done | uniq
1922}
2023
21- # for ubuntu /bin is a symlink to /usr/bin
22- # which -a doesn't know the binaries are the same
23- fix-usr-bin () {
24- sed ' s:^/usr/bin/:/bin/:'
24+ indent () {
25+ sed ' s/^/ /'
2526}
2627
2728printc () {
5556warnings=0
5657
5758echo -n " Checking for \` rbenv' in PATH: "
58- num_locations=" $( command-list rbenv | fix-usr-bin | uniq | count-lines) "
59+ num_locations=" $( command-list rbenv | deduplicate-paths | count-lines) "
5960if [ " $num_locations " -eq 0 ]; then
6061 printc red " not found"
6162 echo
123124echo -n " Checking \` rbenv install' support: "
124125rbenv_installs=" $( { ls " $RBENV_ROOT " /plugins/* /bin/rbenv-install 2> /dev/null || true
125126 command-list rbenv-install 2> /dev/null || true
126- } | uniq ) "
127+ } | deduplicate-paths ) "
127128num_installs=" $( count-lines <<< " $rbenv_installs" ) "
128129if [ -z " $rbenv_installs " ]; then
129130 printc red " not found"
You can’t perform that action at this time.
0 commit comments