Skip to content

Instantly share code, notes, and snippets.

@uratmangun
Created December 28, 2024 14:21
Show Gist options
  • Save uratmangun/8be68e325ceddadd91bedff6f8ae68ff to your computer and use it in GitHub Desktop.
Save uratmangun/8be68e325ceddadd91bedff6f8ae68ff to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { spawn } from 'child_process';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const scriptPath = join(__dirname, '..', 'scripts', 'scrape-or-search.mjs');
const args = process.argv.slice(2);
const child = spawn('node', [scriptPath, ...args], { stdio: 'inherit' });
child.on('error', (error) => {
console.error('Failed to start subprocess:', error);
process.exit(1);
});
child.on('close', (code) => {
process.exit(code);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment