UNPKG

1.04 kBJavaScriptView Raw
1#!/usr/bin/env node
2var spawn = require('cross-spawn');
3var script = process.argv[2];
4var args = process.argv.slice(3);
5
6switch (script) {
7case 'build':
8case 'eject':
9case 'start':
10case 'test':
11 var result = spawn.sync(
12 'node',
13 [require.resolve('../scripts/' + script)].concat(args),
14 {stdio: 'inherit'}
15 );
16 if (result.signal) {
17 if (result.signal == 'SIGKILL') {
18 console.log(
19 'The build failed because the process exited too early. ' +
20 'This probably means the system ran out of memory or someone called ' +
21 '`kill -9` on the process.'
22 );
23 } else if (result.signal == 'SIGTERM') {
24 console.log(
25 'The build failed because the process exited too early. ' +
26 'Someone might have called `kill` or `killall`, or the system could ' +
27 'be shutting down.'
28 );
29 }
30 process.exit(1);
31 }
32 process.exit(result.status);
33 break;
34default:
35 console.log('Unknown script "' + script + '".');
36 console.log('Perhaps you need to update react-scripts?');
37 break;
38}