@guanmu/ccprofile 0.1.6 → 0.1.7
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/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { execSync } from "node:child_process";
|
|
5
6
|
import * as p from "@clack/prompts";
|
|
@@ -347,7 +348,8 @@ Usage:
|
|
|
347
348
|
ccx search <keyword> Search plugins in marketplaces
|
|
348
349
|
ccx <profile> add [plugin] Add plugin to profile
|
|
349
350
|
ccx <profile> remove [plugin] Remove plugin from profile
|
|
350
|
-
ccx <profile> list List plugins in profile
|
|
351
|
+
ccx <profile> list List plugins in profile
|
|
352
|
+
ccx -v, --version Show version`);
|
|
351
353
|
}
|
|
352
354
|
// ── Main ──────────────────────────────────────────────────
|
|
353
355
|
const args = process.argv.slice(2);
|
|
@@ -359,6 +361,12 @@ if (args[0] === "--help" || args[0] === "-h") {
|
|
|
359
361
|
printHelp();
|
|
360
362
|
process.exit(0);
|
|
361
363
|
}
|
|
364
|
+
if (args[0] === "--version" || args[0] === "-v" || args[0] === "-V") {
|
|
365
|
+
const require = createRequire(import.meta.url);
|
|
366
|
+
const pkg = require("../package.json");
|
|
367
|
+
console.log(`ccx v${pkg.version}`);
|
|
368
|
+
process.exit(0);
|
|
369
|
+
}
|
|
362
370
|
const cmd = args[0];
|
|
363
371
|
switch (cmd) {
|
|
364
372
|
case "add":
|