16 lines
630 B
JavaScript
16 lines
630 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Cross-platform launcher: runs dist/media-img or dist/media-img.exe from package root.
|
|
* Used by package.json convenience scripts on Linux, macOS, and Windows.
|
|
*/
|
|
import { spawnSync } from 'node:child_process';
|
|
import { resolve, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const exe = process.platform === 'win32' ? 'media-img.exe' : 'media-img';
|
|
const bin = resolve(root, 'dist', exe);
|
|
const args = process.argv.slice(2);
|
|
const r = spawnSync(bin, args, { stdio: 'inherit' });
|
|
process.exit(r.status ?? 1);
|