mirror of
https://github.com/run-llama/semtools.git
synced 2026-07-20 19:04:20 -04:00
17 lines
575 B
JavaScript
17 lines
575 B
JavaScript
#!/usr/bin/env node
|
|
const { spawn } = require('node:child_process');
|
|
const { join } = require('node:path');
|
|
const { existsSync } = require('node:fs');
|
|
|
|
const isWindows = process.platform === 'win32';
|
|
const exe = isWindows ? '.exe' : '';
|
|
const localPath = join(__dirname, '..', 'dist', 'bin', `ask${exe}`);
|
|
|
|
const bin = existsSync(localPath) ? localPath : `ask${exe}`;
|
|
|
|
const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit', shell: isWindows });
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) process.kill(process.pid, signal);
|
|
process.exit(code ?? 1);
|
|
});
|