MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolveInstalledBundle

Function resolveInstalledBundle

scripts/npm-shim.js:77–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75// Resolve the launcher from the installed per-platform optionalDependency.
76// Returns {command, args} or null if the package isn't installed.
77function resolveInstalledBundle() {
78 try {
79 if (isWindows) {
80 // Modern Node refuses to spawn the bundle's .cmd directly (EINVAL, the
81 // CVE-2024-27980 hardening on Node 24), so invoke the bundled node.exe
82 // against the app entry point and pass --liftoff-only here.
83 var nodeExe = require.resolve(pkg + '/node.exe');
84 var entry = require.resolve(pkg + '/lib/dist/bin/codegraph.js');
85 return { command: nodeExe, args: liftoff(entry) };
86 }
87 return { command: require.resolve(pkg + '/bin/codegraph'), args: process.argv.slice(2) };
88 } catch (e) {
89 return null;
90 }
91}
92
93// Locate the launcher inside an extracted GitHub bundle directory (same
94// node/lib/bin layout as the npm platform package). Returns {command, args} or

Callers 1

mainFunction · 0.85

Calls 2

liftoffFunction · 0.85
resolveMethod · 0.65

Tested by

no test coverage detected