@writechoice/mint-cli 0.0.3 → 0.0.4
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/cli.js +6 -9
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ const program = new Command();
|
|
|
17
17
|
program
|
|
18
18
|
.name("writechoice")
|
|
19
19
|
.description("CLI tool for Mintlify documentation validation and utilities")
|
|
20
|
-
.version(packageJson.version, "-
|
|
20
|
+
.version(packageJson.version, "-v, --version", "Output the current version");
|
|
21
21
|
|
|
22
22
|
// Validate command
|
|
23
23
|
const check = program.command("check").description("Validation commands for documentation");
|
|
@@ -51,10 +51,7 @@ program
|
|
|
51
51
|
|
|
52
52
|
try {
|
|
53
53
|
// Get latest version from npm
|
|
54
|
-
const latestVersion = execSync(
|
|
55
|
-
`npm view ${packageJson.name} version`,
|
|
56
|
-
{ encoding: "utf-8" }
|
|
57
|
-
).trim();
|
|
54
|
+
const latestVersion = execSync(`npm view ${packageJson.name} version`, { encoding: "utf-8" }).trim();
|
|
58
55
|
|
|
59
56
|
const currentVersion = packageJson.version;
|
|
60
57
|
|
|
@@ -83,10 +80,10 @@ program
|
|
|
83
80
|
// Check for updates on every command (non-blocking)
|
|
84
81
|
async function checkForUpdates() {
|
|
85
82
|
try {
|
|
86
|
-
const latestVersion = execSync(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
).trim();
|
|
83
|
+
const latestVersion = execSync(`npm view ${packageJson.name} version 2>/dev/null`, {
|
|
84
|
+
encoding: "utf-8",
|
|
85
|
+
timeout: 2000,
|
|
86
|
+
}).trim();
|
|
90
87
|
|
|
91
88
|
const currentVersion = packageJson.version;
|
|
92
89
|
|