kmod-cli 1.4.12 → 1.4.14
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/index.js +13 -6
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -74,7 +74,7 @@ async function copyComponent(name, collectedDeps) {
|
|
|
74
74
|
const dest = path.join(destBase, relPath);
|
|
75
75
|
|
|
76
76
|
await fs.copy(src, dest, { overwrite: false });
|
|
77
|
-
console.log(`✅
|
|
77
|
+
console.log(`✅ Installed: src/custom/${relPath}`);
|
|
78
78
|
|
|
79
79
|
// Collect deps
|
|
80
80
|
const userPkg = getUserPackageJson();
|
|
@@ -183,16 +183,23 @@ program
|
|
|
183
183
|
.description("CLI to copy component/templates into project")
|
|
184
184
|
.version("1.0.0");
|
|
185
185
|
|
|
186
|
-
program.command("add").description("Select components to add").action(addComponents);
|
|
186
|
+
// program.command("add").description("Select components to add").action(addComponents);
|
|
187
187
|
program
|
|
188
188
|
.command("add [components...]")
|
|
189
|
-
.description("Add components
|
|
190
|
-
.
|
|
189
|
+
.description("Add components")
|
|
190
|
+
.option("--all", "Add all components")
|
|
191
|
+
.action(async (components = [], options) => {
|
|
192
|
+
if (options.all) {
|
|
193
|
+
await addComponents(); //handle --all
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
191
197
|
if (components.length > 0) {
|
|
192
198
|
await addComponentsByName(components);
|
|
193
|
-
|
|
194
|
-
await addComponents();
|
|
199
|
+
return;
|
|
195
200
|
}
|
|
201
|
+
|
|
202
|
+
await addComponents(); // interactive
|
|
196
203
|
});
|
|
197
204
|
|
|
198
205
|
|