MCPcopy Create free account
hub / github.com/wonderwhy-er/DesktopCommanderMCP / getTarget

Function getTarget

scripts/ripgrep-wrapper.js:19–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
19function getTarget() {
20 const arch = process.env.npm_config_arch || os.arch();
21
22 switch (os.platform()) {
23 case 'darwin':
24 return arch === 'arm64' ? 'aarch64-apple-darwin' : 'x86_64-apple-darwin';
25 case 'win32':
26 return arch === 'x64' ? 'x86_64-pc-windows-msvc' :
27 arch === 'arm64' ? 'aarch64-pc-windows-msvc' :
28 'i686-pc-windows-msvc';
29 case 'linux':
30 return arch === 'x64' ? 'x86_64-unknown-linux-musl' :
31 arch === 'arm' ? 'arm-unknown-linux-gnueabihf' :
32 arch === 'armv7l' ? 'arm-unknown-linux-gnueabihf' :
33 arch === 'arm64' ? 'aarch64-unknown-linux-musl' :
34 arch === 'ppc64' ? 'powerpc64le-unknown-linux-gnu' :
35 arch === 's390x' ? 's390x-unknown-linux-gnu' :
36 'i686-unknown-linux-musl';
37 default:
38 throw new Error('Unknown platform: ' + os.platform());
39 }
40}
41
42const target = getTarget();
43const isWindows = os.platform() === 'win32';

Callers 1

ripgrep-wrapper.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected