MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / getCargoExePath

Function getCargoExePath

packages/native/scripts/build-native.mjs:249–261  ·  view source on GitHub ↗
(env)

Source from the content-addressed store, hash-verified

247}
248
249function getCargoExePath(env) {
250 const cargoHome =
251 typeof env.CARGO_HOME === "string" && env.CARGO_HOME.length > 0
252 ? env.CARGO_HOME
253 : typeof env.USERPROFILE === "string" && env.USERPROFILE.length > 0
254 ? join(env.USERPROFILE, ".cargo")
255 : null;
256 if (!cargoHome) return null;
257 const cargoBin = join(cargoHome, "bin");
258 const cargoExe =
259 process.platform === "win32" ? join(cargoBin, "cargo.exe") : join(cargoBin, "cargo");
260 return existsSync(cargoExe) ? cargoExe : null;
261}
262
263function ensureCargoOnPath(env) {
264 if (canRunCargo(env)) return env;

Callers 3

ensureCargoOnPathFunction · 0.85
withRustToolchainOnPathFunction · 0.85
buildWithCargoDirectlyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected