From 499d82af8a49e826cdd23d72e79553aac3ef70e2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 22 Feb 2023 12:46:07 -0800 Subject: [PATCH] tool/gocross: add command to print the wrapper shell script So that when importing and using gocross from other repos, there's an easy way to get at the right wrapper script that's in sync with the gocross binary. Signed-off-by: David Anderson --- tool/gocross/gocross.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tool/gocross/gocross.go b/tool/gocross/gocross.go index b036b6be0..a1e22c819 100644 --- a/tool/gocross/gocross.go +++ b/tool/gocross/gocross.go @@ -56,6 +56,9 @@ func main() { } fmt.Println(filepath.Join(toolchain, "bin/go")) os.Exit(0) + case "gocross-print-wrapper-script": + fmt.Println(wrapperScript) + os.Exit(0) } } @@ -94,6 +97,9 @@ func main() { doExec(filepath.Join(toolchain, "bin/go"), args, os.Environ()) } +//go:embed gocross-wrapper.sh +var wrapperScript string + func debug(format string, args ...interface{}) { debug := os.Getenv("GOCROSS_DEBUG") var (