hyperp 1.0.3 → 1.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.
Files changed (2) hide show
  1. package/cli/bin/hyperp.js +24 -1
  2. package/package.json +1 -1
package/cli/bin/hyperp.js CHANGED
@@ -4,6 +4,29 @@ const { Command } = require("commander");
4
4
  const { deploy } = require("./commands/deploy");
5
5
  const { destroy } = require("./commands/destroy");
6
6
  const { listRuns } = require("./commands/list-runs");
7
+ const path = require("path");
8
+ const fs = require("fs");
9
+
10
+ // Read version from package.json (try multiple possible locations)
11
+ function getVersion() {
12
+ const possiblePaths = [
13
+ path.join(__dirname, "../../package.json"), // From npm package
14
+ path.join(__dirname, "../../../package.json"), // From npm package (alternative)
15
+ path.join(__dirname, "../../../../package.json"), // From npm package (another alternative)
16
+ ];
17
+
18
+ for (const pkgPath of possiblePaths) {
19
+ if (fs.existsSync(pkgPath)) {
20
+ try {
21
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
22
+ return pkg.version || "1.0.0";
23
+ } catch (e) {
24
+ // Continue to next path
25
+ }
26
+ }
27
+ }
28
+ return "1.0.0"; // Fallback
29
+ }
7
30
 
8
31
  const program = new Command();
9
32
 
@@ -12,7 +35,7 @@ program
12
35
  .description(
13
36
  "CLI tool for Hyperp - Fully automated pay-as-you-go compute platform"
14
37
  )
15
- .version("1.0.0");
38
+ .version(getVersion());
16
39
 
17
40
  program
18
41
  .command("deploy")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Fully automated servereless compute platform on AWS",
5
5
  "main": "index.js",
6
6
  "bin": {