INNER CODE UNIT · JavaScript
resolveBinaryPath
containers/kubernetes-mcp-server · npm/kubernetes-mcp-server/bin/index.js:15
const resolveBinaryPath = () => {
try {
const binary = BINARY_MAP[`${process.platform}_${process.arch}`];
return require.resolve(`${binary.name}/bin/${binary.name}${binary.suffix}`);
} catch (e) {
throw new Error(`Could not resolve binary path for platform/arch: ${process.platform}/${process.arch}`);
}
};
const child = childProcess.spawn(resolveBinaryPath(), process.argv.slice(2), {
stdio: 'inherit',
});
const handleSignal = () => (signal) => {
// SIGHUP no longer terminates the child (it reloads with a config, ignores
// without), but still forward it so `kill -HUP` on this parent can trigger a
// reload. Just don't log it as a termination.
if (signal === 'SIGHUP') {