Created
December 28, 2024 14:21
-
-
Save uratmangun/8be68e325ceddadd91bedff6f8ae68ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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