forked from Bostwickenator/ch.rip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchirp.js
More file actions
22 lines (18 loc) · 669 Bytes
/
chirp.js
File metadata and controls
22 lines (18 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const path = require('path');
const { spawn } = require('child_process');
console.log("It looks like you've typed 'chirp.js' but the script is 'chrip.js'; it's a kind of joke you see...");
console.log("Don't worry, I'll run it for you in a moment.");
setTimeout(() => {
console.log("Running chrip.js...");
const child = spawn('node', [path.join(__dirname, 'chrip.js')], {
stdio: 'inherit'
});
child.on('error', (error) => {
console.error('Failed to start chrip.js:', error);
});
child.on('close', (code) => {
if (code !== 0) {
console.log(`chrip.js exited with code ${code}`);
}
});
}, 5000);