@appthen/cli 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{code-generator.js → main.js} +18 -1
- package/dist/index.js +37 -11
- package/dist/index.js.map +1 -1
- package/package.json +24 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable prefer-arrow-callback */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
var pkg = require('../package.json');
|
|
7
7
|
|
|
8
8
|
var program = require('commander');
|
|
9
9
|
|
|
@@ -65,4 +65,21 @@ program
|
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
+
program
|
|
69
|
+
.command('create', { isDefault: false })
|
|
70
|
+
.description('Create a new project from template')
|
|
71
|
+
.requiredOption('-t, --template <template>', 'template name')
|
|
72
|
+
.requiredOption('-f, --folder <folder>', 'folder name')
|
|
73
|
+
.action(async function doInit(command) {
|
|
74
|
+
var options = command?.opts?.() || {};
|
|
75
|
+
if (options.cwd) {
|
|
76
|
+
process.chdir(options.cwd);
|
|
77
|
+
}
|
|
78
|
+
require('../dist/index.js')
|
|
79
|
+
.create(options)
|
|
80
|
+
.then((retCode) => {
|
|
81
|
+
process.exit(retCode);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
68
85
|
program.parse(process.argv);
|