palmier 0.1.3 → 0.1.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/dist/index.js CHANGED
@@ -1,15 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import "dotenv/config";
3
+ import { readFileSync } from "fs";
4
+ import { fileURLToPath } from "url";
5
+ import { dirname, join } from "path";
3
6
  import { Command } from "commander";
4
7
  import { initCommand } from "./commands/init.js";
5
8
  import { runCommand } from "./commands/run.js";
6
9
  import { hookCommand } from "./commands/hook.js";
7
10
  import { serveCommand } from "./commands/serve.js";
11
+ const __dirname = dirname(fileURLToPath(import.meta.url));
12
+ const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
8
13
  const program = new Command();
9
14
  program
10
15
  .name("palmier")
11
16
  .description("Palmier agent CLI")
12
- .version("0.1.0");
17
+ .version(pkg.version);
13
18
  program
14
19
  .command("init")
15
20
  .description("Provision this agent with a provisioning token")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Palmier agent CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "ISC",
6
6
  "author": "Hongxu Cai",
package/src/index.ts CHANGED
@@ -1,18 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import "dotenv/config";
4
+ import { readFileSync } from "fs";
5
+ import { fileURLToPath } from "url";
6
+ import { dirname, join } from "path";
4
7
  import { Command } from "commander";
5
8
  import { initCommand } from "./commands/init.js";
6
9
  import { runCommand } from "./commands/run.js";
7
10
  import { hookCommand } from "./commands/hook.js";
8
11
  import { serveCommand } from "./commands/serve.js";
9
12
 
13
+ const __dirname = dirname(fileURLToPath(import.meta.url));
14
+ const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
15
+
10
16
  const program = new Command();
11
17
 
12
18
  program
13
19
  .name("palmier")
14
20
  .description("Palmier agent CLI")
15
- .version("0.1.0");
21
+ .version(pkg.version);
16
22
 
17
23
  program
18
24
  .command("init")