diff --git a/dist/config.js b/dist/config.js index 7caa66d2676933b102431ec8d92c571eb9d6d82c..77103b9d9573e56c26014c8c7c918e1f853afcdc 100644 --- a/dist/config.js +++ b/dist/config.js @@ -10,8 +10,11 @@ const __dirname = dirname(__filename); /** * Detect if we're running as a Bun compiled binary. * Bun binaries have import.meta.url containing "$bunfs", "~BUN", or "%7EBUN" (Bun's virtual filesystem path) + * Some packaging workflows keep import.meta.url as a file:// path, so fall back to execPath next to package.json. */ -export const isBunBinary = import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN"); +const bunBinaryByUrl = import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN"); +const bunBinaryByExecPath = existsSync(join(dirname(process.execPath), "package.json")); +export const isBunBinary = bunBinaryByUrl || bunBinaryByExecPath; // ============================================================================= // Package Asset Paths (shipped with executable) // =============================================================================