Skip to content

Commit 8631f46

Browse files
Replace hardcoded /bin/ls with ls for better portability
Co-authored-by: ChronosMasterOfAllTime <28963807+ChronosMasterOfAllTime@users.noreply.github.com>
1 parent f2c3738 commit 8631f46

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

libexec/goenv-version-name

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ version_exists() {
3636
version_regex="${version_regex}(\\.[0-9]+)?"
3737
fi
3838

39-
local versions=($(/bin/ls ${GOENV_ROOT}/versions | grep -E "^$version_regex$" | sort -V))
39+
local versions=($(ls ${GOENV_ROOT}/versions | grep -E "^$version_regex$" | sort -V))
4040
IFS="$OLDIFS"
4141
if [[ ${#versions[@]} -eq 0 ]]; then
4242
return 1

libexec/goenv-which

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ version_exists() {
6767
OLDIFS="$IFS"
6868
IFS=$'\n'
6969
local version_regex=$(echo ${input_version} | sed s/\\./\\\\./)
70-
local versions=($(/bin/ls ${GOENV_ROOT}/versions | grep -E "^$version_regex(\\.[0-9]+)?$" | sort -V))
70+
local versions=($(ls ${GOENV_ROOT}/versions | grep -E "^$version_regex(\\.[0-9]+)?$" | sort -V))
7171
IFS="$OLDIFS"
7272
if [[ ${#versions[@]} -eq 0 ]]; then
7373
return 1

plugins/go-build/test/installer.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ load test_helper
2222
PREFIX="${PWD}/usr" run "${BATS_TEST_DIRNAME}/../install.sh"
2323
assert_success ""
2424

25-
run $BASH -c '/bin/ls -l usr/share/go-build | tail -2 | cut -c1-10'
25+
run $BASH -c 'ls -l usr/share/go-build | tail -2 | cut -c1-10'
2626
assert_success_out <<OUT
2727
-rw-r--r--
2828
-rw-r--r--
@@ -56,6 +56,6 @@ OUT
5656
assert [ -e bin/bananas ]
5757
assert [ -e share/bananas/docs ]
5858

59-
run /bin/ls -ld bin
59+
run ls -ld bin
6060
assert_equal "r-x" "${output:4:3}"
6161
}

test/goenv-rehash.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ OUT
4949
run goenv-rehash
5050
assert_success ""
5151

52-
run /bin/ls "${GOENV_ROOT}/shims"
52+
run ls "${GOENV_ROOT}/shims"
5353
assert_success_out <<OUT
5454
go
5555
godoc
@@ -161,7 +161,7 @@ OUT
161161
run goenv-rehash
162162
assert_success ""
163163

164-
run /bin/ls "${GOENV_ROOT}/shims"
164+
run ls "${GOENV_ROOT}/shims"
165165
assert_success "go"
166166

167167
run type go

test/goenv-sh-rehash.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ OUT
482482
run goenv-sh-rehash
483483
assert_success ""
484484

485-
run /bin/ls "${GOENV_ROOT}/shims"
485+
run ls "${GOENV_ROOT}/shims"
486486
assert_success_out <<OUT
487487
go
488488
godoc
@@ -598,7 +598,7 @@ OUT
598598
run goenv-sh-rehash
599599
assert_success ""
600600

601-
run /bin/ls "${GOENV_ROOT}/shims"
601+
run ls "${GOENV_ROOT}/shims"
602602
assert_success_out <<OUT
603603
go
604604
OUT

0 commit comments

Comments
 (0)