From ff6834844209a4b9df495ef51b800adac09f25f7 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Tue, 25 Nov 2025 13:54:05 -0300 Subject: [PATCH] fix(tauri): usa tauri.cmd real via node_modules/.bin e cwd correto --- apps/desktop/scripts/tauri-with-stub.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/desktop/scripts/tauri-with-stub.mjs b/apps/desktop/scripts/tauri-with-stub.mjs index 974ca3f..459cd17 100644 --- a/apps/desktop/scripts/tauri-with-stub.mjs +++ b/apps/desktop/scripts/tauri-with-stub.mjs @@ -1,9 +1,11 @@ import { spawn } from "node:child_process" import { fileURLToPath } from "node:url" import { dirname, resolve } from "node:path" +import { existsSync } from "node:fs" const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) +const appRoot = resolve(__dirname, "..") const pathKey = process.platform === "win32" ? "Path" : "PATH" const currentPath = process.env[pathKey] ?? process.env[pathKey.toUpperCase()] ?? "" @@ -23,10 +25,12 @@ if (!process.env.TAURI_BUNDLE_TARGETS) { } } -const executable = process.platform === "win32" ? resolve(stubDir, "tauri.cmd") : "tauri" +const winTauriPath = resolve(appRoot, "node_modules", ".bin", "tauri.cmd") +const executable = process.platform === "win32" && existsSync(winTauriPath) ? winTauriPath : "tauri" const child = spawn(executable, process.argv.slice(2), { stdio: "inherit", shell: false, + cwd: appRoot, }) child.on("exit", (code, signal) => {