Skip to content

Commit ea12d81

Browse files
committed
Fix Github Actions tests workflow on newer versions of Ubuntu
1 parent 4591bcc commit ea12d81

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
defaults:
2727
run:
28-
shell: bash -i {0}
28+
shell: 'script -q -e -c "bash -i -eo pipefail {0}"'
2929

3030
steps:
3131
- name: Checkout code

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Add description and website to help command
6+
- Fix Github Actions tests workflow on newer versions of Ubuntu
67

78
## 0.9.1 - 2022-10-23
89

bin/g

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -588,24 +588,22 @@ set_version() {
588588
error_and_abort "Version $version is not available. Use 'g install $version' to install it."
589589
fi
590590

591-
if [ "$version" != "$active" ]; then
592-
if [ ! -e "$dir/g.lock" ]; then
593-
for file in "$dir/"*; do
594-
if [ -L "${GOROOT:?}/$(basename "$file")" ]; then
595-
rm "${GOROOT:?}/$(basename "$file")"
596-
elif [ -e "${GOROOT:?}/$(basename "$file")" ]; then
597-
# enable seamless upgrade to symlink behavior
598-
rm -rf "${GOROOT:?}/$(basename "$file")"
599-
fi
600-
ln -sf "$file" "${GOROOT:?}/$(basename "$file")"
601-
done
591+
if [ ! -e "$dir/g.lock" ]; then
592+
for file in "$dir/"*; do
593+
if [ -L "${GOROOT:?}/$(basename "$file")" ]; then
594+
rm "${GOROOT:?}/$(basename "$file")"
595+
elif [ -e "${GOROOT:?}/$(basename "$file")" ]; then
596+
# enable seamless upgrade to symlink behavior
597+
rm -rf "${GOROOT:?}/$(basename "$file")"
598+
fi
599+
ln -sf "$file" "${GOROOT:?}/$(basename "$file")"
600+
done
602601

603-
for file in "$dir/bin/"*; do
604-
ln -sf "$GOROOT/bin/$(basename "$file")" "$GOPATH/bin/"
605-
done
606-
else
607-
error_and_abort "version $version installation might be corrupted"
608-
fi
602+
for file in "$dir/bin/"*; do
603+
ln -sf "$GOROOT/bin/$(basename "$file")" "$GOPATH/bin/"
604+
done
605+
else
606+
error_and_abort "version $version installation might be corrupted"
609607
fi
610608
}
611609

0 commit comments

Comments
 (0)