@decodo/cli
Advanced tools
| #!/usr/bin/env node | ||
| import { readFileSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
| import { Command } from "commander"; | ||
@@ -8,7 +9,4 @@ import { createCommands } from "./cli/register.js"; | ||
| function readVersion() { | ||
| const entry = process.argv[1]; | ||
| if (!entry) { | ||
| throw new Error("Unable to resolve CLI entry path"); | ||
| } | ||
| const packageJsonPath = join(dirname(entry), "..", "..", "package.json"); | ||
| const __filename = fileURLToPath(import.meta.url); | ||
| const packageJsonPath = join(dirname(__filename), "..", "..", "package.json"); | ||
| const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8")); | ||
@@ -15,0 +13,0 @@ return pkg.version; |
+1
-1
| { | ||
| "name": "@decodo/cli", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "Official CLI for the Decodo APIs", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
58723
-0.03%1170
-0.17%