-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcli.js
31 lines (25 loc) · 723 Bytes
/
cli.js
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
#!/usr/bin/env node
// Entry point for library consumers to run scripts
let command = process.argv[2];
function throwUsageError(message) {
throw new Error(
(message ? message + '\n\n' : '') +
'Please call `onlineberatung-frontend` with one of the available commands:' +
'\n - `start`: Start the development server' +
'\n - `build`: Build the app for production' +
'\n'
);
}
if (!command) {
throwUsageError('No command provided');
}
command = command.trim();
if (command === 'start') {
require('./proxy/server.js');
} else if (command === 'dev') {
require('./scripts/start');
} else if (command === 'build') {
require('./scripts/build');
} else {
throwUsageError(`Unknown command: ${command}`);
}