ezhst 0.4.1 → 1.0.0
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 +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
3
4
|
import { forgotPassword, login, logout, register, resendVerification, whoami } from "./commands/auth.js";
|
|
4
5
|
import { createApp, deleteApp, listApps } from "./commands/apps.js";
|
|
5
6
|
import { createSchedule, deleteSchedule, listSchedules, scheduleLogs, setScheduleState, updateSchedule } from "./commands/schedules.js";
|
|
@@ -14,11 +15,15 @@ import { createSender, deleteSender, emailInfo, emailLogs, sendEmail } from "./c
|
|
|
14
15
|
import { createKey, listKeys, revokeKey } from "./commands/keys.js";
|
|
15
16
|
import { installSkill } from "./commands/skill.js";
|
|
16
17
|
import { fail, setJsonMode } from "./lib/ui.js";
|
|
18
|
+
const packageMetadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
19
|
+
if (!packageMetadata || typeof packageMetadata !== "object" || !("version" in packageMetadata) || typeof packageMetadata.version !== "string") {
|
|
20
|
+
throw new Error("CLI package version is missing or malformed");
|
|
21
|
+
}
|
|
17
22
|
const program = new Command();
|
|
18
23
|
program
|
|
19
24
|
.name("ezhst")
|
|
20
25
|
.description("EasyHost from the terminal: deploy apps and manage storage, databases, email and API keys")
|
|
21
|
-
.version(
|
|
26
|
+
.version(packageMetadata.version)
|
|
22
27
|
.option("--json", "Print machine-readable JSON")
|
|
23
28
|
.hook("preAction", (_command, action) => {
|
|
24
29
|
setJsonMode(!!action.optsWithGlobals().json);
|