From 955d0e9ba967454f94a0a74eabaf971a89c04d18 Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Sun, 20 Oct 2024 12:42:34 -0400 Subject: [PATCH] fix: use 'go env GOROOT' when GOROOT env is missing --- packages/@cdktf/hcl-tools/prebuild.sh | 2 ++ packages/@cdktf/hcl2json/prebuild.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/@cdktf/hcl-tools/prebuild.sh b/packages/@cdktf/hcl-tools/prebuild.sh index 7fdfb6863e..4a845b274f 100755 --- a/packages/@cdktf/hcl-tools/prebuild.sh +++ b/packages/@cdktf/hcl-tools/prebuild.sh @@ -4,6 +4,8 @@ set -euo pipefail +GOROOT="${GOROOT:-$(go env GOROOT)}" + if [[ -z "${GOROOT-}" ]]; then echo "GOROOT environment variable needs to be set!" exit 1 diff --git a/packages/@cdktf/hcl2json/prebuild.sh b/packages/@cdktf/hcl2json/prebuild.sh index 7fdfb6863e..4a845b274f 100755 --- a/packages/@cdktf/hcl2json/prebuild.sh +++ b/packages/@cdktf/hcl2json/prebuild.sh @@ -4,6 +4,8 @@ set -euo pipefail +GOROOT="${GOROOT:-$(go env GOROOT)}" + if [[ -z "${GOROOT-}" ]]; then echo "GOROOT environment variable needs to be set!" exit 1