-
Notifications
You must be signed in to change notification settings - Fork 0
/
assembleRun.ts
executable file
·38 lines (32 loc) · 1.19 KB
/
assembleRun.ts
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
#!/usr/bin/env node
import { startGeneration } from './uxLibraryGenerator';
import * as colors from 'colors/safe';
let projectRootFolder = '.';
let configFilePath = 'src/ux-library/ux-library-config.json';
const commandLineArguments = process.argv;
commandLineArguments.forEach((argument, index) => {
switch (argument) {
case '--config':
// load parameter
if (commandLineArguments.length === index) {
console.error(`--config parameter provided but no value given`);
return;
}
configFilePath = commandLineArguments[index + 1];
console.info(`Using provided config file : ${configFilePath}`);
break;
case '--rootFolder':
// load parameter
if (commandLineArguments.length === index) {
console.error(`--rootFolder parameter provided but no value given`);
return;
}
projectRootFolder = commandLineArguments[index + 1];
console.info(`Using provided project root folder : ${projectRootFolder}`);
break;
}
});
console.info(colors.green(`Starting UX Library Generator....`));
startGeneration(projectRootFolder, configFilePath, () => {
console.info(colors.green(`UX Library Generation Completed.`));
});