fix: download-to-file with retries (a truncated piped stream half-extracts the GOROOT)
This commit is contained in:
+5
-1
@@ -17,7 +17,11 @@ runs:
|
|||||||
*) echo "better-setup-go: unsupported arch $(uname -m)" >&2; exit 1 ;;
|
*) echo "better-setup-go: unsupported arch $(uname -m)" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
rm -rf /usr/local/go # a base-image GOROOT under the same path corrupts on overlay
|
rm -rf /usr/local/go # a base-image GOROOT under the same path corrupts on overlay
|
||||||
curl -fsSL "https://go.dev/dl/go${v}.linux-${arch}.tar.gz" | tar -xz -C /usr/local
|
# download-to-file with retries: a piped stream that truncates mid-archive leaves a
|
||||||
|
# half-extracted GOROOT that fails far away from its cause
|
||||||
|
curl --retry 3 --retry-delay 2 -fsSL -o /tmp/go.tgz "https://go.dev/dl/go${v}.linux-${arch}.tar.gz"
|
||||||
|
tar -xzf /tmp/go.tgz -C /usr/local
|
||||||
|
rm -f /tmp/go.tgz
|
||||||
ln -sf /usr/local/go/bin/go /usr/local/bin/go
|
ln -sf /usr/local/go/bin/go /usr/local/bin/go
|
||||||
ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
||||||
go version
|
go version
|
||||||
|
|||||||
Reference in New Issue
Block a user