|
5 | 5 | /** |
6 | 6 | * External dependencies |
7 | 7 | */ |
8 | | -const spawn = require("cross-spawn"); |
| 8 | +const spawn = require('cross-spawn'); |
9 | 9 |
|
10 | 10 | /** |
11 | 11 | * Internal dependencies |
12 | 12 | */ |
13 | | -const { getArgs } = require("../utils"); |
| 13 | +const { getArgs } = require('../utils'); |
14 | 14 |
|
15 | 15 | const [script, ...args] = getArgs(); |
16 | 16 |
|
17 | | -if (!["build", "lint-js", "lint-style", "start"].includes(script)) { |
| 17 | +if (!['build', 'lint-js', 'lint-style', 'start'].includes(script)) { |
18 | 18 | if (undefined === script) { |
19 | | - console.log("No script specified."); |
| 19 | + console.log('No script specified.'); |
20 | 20 | } else { |
21 | 21 | console.log('Unknown script "' + script + '".'); |
22 | 22 | } |
23 | 23 | process.exit(1); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | const { signal, status } = spawn.sync( |
27 | | - "node", |
28 | | - [require.resolve("../scripts/" + script), ...args], |
29 | | - { stdio: "inherit" } |
| 27 | + 'node', |
| 28 | + [require.resolve('../scripts/' + script), ...args], |
| 29 | + { stdio: 'inherit' } |
30 | 30 | ); |
31 | 31 |
|
32 | 32 | if (signal) { |
33 | | - if (signal === "SIGKILL") { |
| 33 | + if (signal === 'SIGKILL') { |
34 | 34 | console.log( |
35 | | - "The script failed because the process exited too early. " + |
36 | | - "This probably means the system ran out of memory or someone called " + |
37 | | - "`kill -9` on the process." |
| 35 | + 'The script failed because the process exited too early. ' + |
| 36 | + 'This probably means the system ran out of memory or someone called ' + |
| 37 | + '`kill -9` on the process.' |
38 | 38 | ); |
39 | | - } else if (signal === "SIGTERM") { |
| 39 | + } else if (signal === 'SIGTERM') { |
40 | 40 | console.log( |
41 | | - "The script failed because the process exited too early. " + |
42 | | - "Someone might have called `kill` or `killall`, or the system could " + |
43 | | - "be shutting down." |
| 41 | + 'The script failed because the process exited too early. ' + |
| 42 | + 'Someone might have called `kill` or `killall`, or the system could ' + |
| 43 | + 'be shutting down.' |
44 | 44 | ); |
45 | 45 | } |
46 | 46 | process.exit(1); |
|
0 commit comments