From 84859fd4ca291e96c3b2d644e16412115eb4320c Mon Sep 17 00:00:00 2001 From: Luca Stefano Sartori Date: Mon, 26 Oct 2026 01:35:19 +0100 Subject: [PATCH] Find the Go license in Homebrew installations when bundling --- scripts/build-bundle.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/build-bundle.mjs b/scripts/build-bundle.mjs index 292697e..49bd67f 100644 --- a/scripts/build-bundle.mjs +++ b/scripts/build-bundle.mjs @@ -86,7 +86,10 @@ try { } } const goroot = execFileSync('go', ['env', 'GOROOT'], { cwd: root, encoding: 'utf8' }).trim(); - await fs.copyFile(path.join(goroot, 'LICENSE'), path.join(bundle, 'notices/Go-LICENSE')); + // Homebrew's GOROOT is libexec, with LICENSE one level up. + const goLicense = await fs.access(path.join(goroot, 'LICENSE')) + .then(() => path.join(goroot, 'LICENSE'), () => path.join(goroot, '..', 'LICENSE')); + await fs.copyFile(goLicense, path.join(bundle, 'notices/Go-LICENSE')); await fs.copyFile(path.join(root, 'README.md'), path.join(bundle, 'README.md')); await fs.copyFile(path.join(root, 'LICENSE'), path.join(bundle, 'LICENSE')); if (process.platform === 'linux') {