diff --git a/tools/update-shims.sh b/tools/update-shims.sh index 17fa2c9..a476156 100755 --- a/tools/update-shims.sh +++ b/tools/update-shims.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env -S bash -euxo pipefail +#!/usr/bin/env -S bash -euo pipefail # Regenerate all shim packages from the local typescript-go source. # Usage: ./tools/update-shims.sh @@ -13,17 +13,24 @@ cd "$(git rev-parse --show-toplevel)" # Reset tsgo to the clean submodule pointer, then apply patches -pushd extern/typescript-go -git checkout "$(git -C ../.. rev-parse HEAD:extern/typescript-go)" +echo "resetting extern/typescript-go to submodule pointer..." +cd extern/typescript-go +git checkout -q "$(git -C ../.. rev-parse HEAD:extern/typescript-go)" TSGO_COMMIT="$(git rev-parse HEAD)" if ls ../../patches/tsgo/*.patch &>/dev/null; then - git am --3way --no-gpg-sign ../../patches/tsgo/*.patch + echo "applying patches..." + git am --3way --no-gpg-sign -q ../../patches/tsgo/*.patch fi -popd +cd ../.. -find ./shim -type f -name 'go.mod' -execdir go get -x "github.com/microsoft/typescript-go@$TSGO_COMMIT" \; -execdir go mod tidy -v \; -go mod tidy +echo "updating shim go.mod files (tsgo @ ${TSGO_COMMIT:0:12})..." +find ./shim -type f -name 'go.mod' -execdir go get "github.com/microsoft/typescript-go@$TSGO_COMMIT" \; -execdir go mod tidy \; 2>&1 | grep -v '^go: ' || true +go mod tidy 2>&1 | grep -v '^go: ' || true +echo "generating shims..." go run ./tools/gen_shims +echo "verifying build..." go build ./... + +echo "done."