UNPKG

1.64 kBJavaScriptView Raw
1(function (factory) {
2 if (typeof module === "object" && typeof module.exports === "object") {
3 var v = factory(require, exports);
4 if (v !== undefined) module.exports = v;
5 }
6 else if (typeof define === "function" && define.amd) {
7 define(["require", "exports", "path", "./common-cli"], factory);
8 }
9})(function (require, exports) {
10 "use strict";
11 Object.defineProperty(exports, "__esModule", { value: true });
12 exports.LeanupCLI = void 0;
13 const path = require("path");
14 const common_cli_1 = require("./common-cli");
15 class LeanupCLI extends common_cli_1.CommonCLI {
16 constructor(name, version) {
17 super(name, version);
18 this.addActionToCommand('create', (options) => {
19 this.copyAndPrint(path.join(__dirname, '../template'), '', options);
20 ['e2e', 'format', 'lint', 'test'].forEach((plugin) => {
21 try {
22 this.copyAndPrint(path.join(require(`@leanup/cli-core-${plugin}`), 'template'), '', options);
23 }
24 catch (error) { }
25 });
26 ['cli-addons', 'cli-cucumber', 'cli-graphql', 'cli-pwa', 'cli-webhint', 'git-hooks'].forEach((plugin) => {
27 try {
28 this.copyAndPrint(path.join(require(`@leanup/${plugin}`), 'template'), '', Object.assign(Object.assign({}, options), { overwrite: true }));
29 }
30 catch (error) { }
31 });
32 });
33 }
34 }
35 exports.LeanupCLI = LeanupCLI;
36});
37//# sourceMappingURL=leanup-cli.js.map
\No newline at end of file