1 | #!/usr/bin/env node
|
2 | "use strict";
|
3 | var cli_1 = require("./cli");
|
4 | var transform_engine_1 = require("./transform-engine");
|
5 | var fs = require("fs");
|
6 | var options = cli_1.initCLI(process.argv);
|
7 | cli_1.validateCliOptions(options);
|
8 | cli_1.transformOptions(options)
|
9 | .then(transform_engine_1.Transform)
|
10 | .then(function (generationResult) {
|
11 | generationResult.forEach(function (file) {
|
12 | if (file.isDev) {
|
13 | console.log("================== " + file.path + " ==================");
|
14 | console.log(file.content);
|
15 | }
|
16 | else {
|
17 | fs.writeFileSync(file.path, file.content);
|
18 | console.log("Generated file written to " + file.path);
|
19 | }
|
20 | });
|
21 | })
|
22 | .catch(cli_1.cliError);
|
23 |
|
\ | No newline at end of file |