MCPcopy Create free account
hub / github.com/delinoio/oss / tauriEnvironment

Function tauriEnvironment

scripts/tauri-cli.mjs:24–41  ·  view source on GitHub ↗
(
  executable,
  environment = process.env,
  platform = process.platform,
)

Source from the content-addressed store, hash-verified

22// Generated Xcode and Gradle steps invoke cargo-tauri through Cargo. Keep
23// their child environment bound to the same verified executable as the caller.
24export function tauriEnvironment(
25 executable,
26 environment = process.env,
27 platform = process.platform,
28) {
29 const windows = platform === "win32";
30 const keys = Object.keys(environment).filter((key) =>
31 windows ? key.toLowerCase() === "path" : key === "PATH",
32 );
33 const key = keys[0] ?? (windows ? "Path" : "PATH");
34 const result = { ...environment };
35 for (const existing of keys) delete result[existing];
36 const inherited = environment[key];
37 result[key] =
38 (windows ? win32 : posix).dirname(executable) +
39 (inherited ? `${windows ? ";" : ":"}${inherited}` : "");
40 return result;
41}
42// Keep argv structured even for synchronous package builders. The wrapper
43// validates the host binary before delegating its original Tauri arguments.
44export function tauriCommand(args) {

Callers 2

tauri-cli.mjsFile · 0.85
prebuilt.test.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected