aioengine 0.1.1 → 0.1.2
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/package.json +1 -1
- package/src/index.js +15 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -5,13 +5,14 @@ import pc from "picocolors";
|
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { execSync } from "node:child_process";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
8
9
|
|
|
9
10
|
const program = new Command();
|
|
10
11
|
|
|
11
12
|
program
|
|
12
13
|
.name("aioengine")
|
|
13
14
|
.description("AI change control for developers using AI coding tools.")
|
|
14
|
-
.version(
|
|
15
|
+
.version(getCliVersion());
|
|
15
16
|
|
|
16
17
|
program
|
|
17
18
|
.command("init")
|
|
@@ -894,4 +895,17 @@ Do not add dependencies without a clear reason.
|
|
|
894
895
|
|
|
895
896
|
For UI-only tasks, avoid backend, API, database, and config changes.
|
|
896
897
|
`;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function getCliVersion() {
|
|
901
|
+
try {
|
|
902
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
903
|
+
const currentDir = path.dirname(currentFile);
|
|
904
|
+
const packagePath = path.join(currentDir, "..", "package.json");
|
|
905
|
+
const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf8"));
|
|
906
|
+
|
|
907
|
+
return packageJson.version ?? "0.0.0";
|
|
908
|
+
} catch {
|
|
909
|
+
return "0.0.0";
|
|
910
|
+
}
|
|
897
911
|
}
|