forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-build.mjs
More file actions
54 lines (47 loc) · 1.19 KB
/
Copy pathrun-build.mjs
File metadata and controls
54 lines (47 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env node
/**
* axe-core build driver (replaces Gruntfile.js).
*/
process.env.NODE_NO_HTTP2 = '1';
export { parseBuildArgv, deriveLangSuffixes } from './run-build/argv.mjs';
import { parseBuildArgv } from './run-build/argv.mjs';
import {
runConfigureCommand,
runFullBuild,
runTranslateCommand,
runValidateCommand
} from './run-build/commands.mjs';
import { runWatchMode } from './run-build/watch-mode.mjs';
async function main() {
const parsed = parseBuildArgv(process.argv);
if (parsed.watch && parsed.sub !== 'build') {
console.error('--watch is only supported for the default build');
process.exitCode = 1;
return;
}
if (parsed.watch) {
await runWatchMode(parsed);
return;
}
switch (parsed.sub) {
case 'build':
await runFullBuild(parsed);
break;
case 'configure':
await runConfigureCommand(parsed);
break;
case 'translate':
await runTranslateCommand(parsed);
break;
case 'validate':
await runValidateCommand();
break;
default:
console.error(`Unknown command: ${parsed.sub}`);
process.exitCode = 1;
}
}
main().catch(err => {
console.error(err);
process.exitCode = 1;
});