@cruxgarden/cli 0.0.2 → 0.0.3
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/crux.js +12 -3
- package/package.json +1 -1
package/bin/crux.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { program } from "commander";
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
import { join, dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
3
6
|
import {
|
|
4
7
|
showBanner,
|
|
5
8
|
startNursery,
|
|
@@ -17,10 +20,16 @@ import {
|
|
|
17
20
|
stopNurseryDb,
|
|
18
21
|
} from "../lib/commands.js";
|
|
19
22
|
|
|
23
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
24
|
+
const __dirname = dirname(__filename);
|
|
25
|
+
const packageJson = JSON.parse(
|
|
26
|
+
readFileSync(join(__dirname, "..", "package.json"), "utf-8"),
|
|
27
|
+
);
|
|
28
|
+
|
|
20
29
|
program
|
|
21
30
|
.name("crux")
|
|
22
|
-
.description("Crux Garden CLI
|
|
23
|
-
.version(
|
|
31
|
+
.description("Crux Garden CLI")
|
|
32
|
+
.version(packageJson.version);
|
|
24
33
|
|
|
25
34
|
// Nursery environment commands
|
|
26
35
|
const nursery = program
|
|
@@ -29,7 +38,7 @@ const nursery = program
|
|
|
29
38
|
|
|
30
39
|
nursery
|
|
31
40
|
.command("start")
|
|
32
|
-
.description("Start the Nursery environment (postgres, redis
|
|
41
|
+
.description("Start the Nursery environment (api, postgres, redis)")
|
|
33
42
|
.option("--db-only", "Start only database services (postgres, redis)")
|
|
34
43
|
.option("--no-banner", "Hide the startup banner")
|
|
35
44
|
.action((options) => {
|