@besales/ops-framework 0.1.12 → 0.1.13
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/CHANGELOG.md +4 -0
- package/bin/ops-agent.mjs +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.13
|
|
4
|
+
|
|
5
|
+
- Fixed `ops-agent --version` to read the installed package version instead of printing a stale hardcoded value.
|
|
6
|
+
|
|
3
7
|
## 0.1.12
|
|
4
8
|
|
|
5
9
|
- Auto-included detected relevant initiative sources when an intake run uses `--include`, unless `--no-include-relevant` is passed.
|
package/bin/ops-agent.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
2
3
|
import { spawnSync } from 'node:child_process';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { fileURLToPath } from 'node:url';
|
|
@@ -51,7 +52,7 @@ function main() {
|
|
|
51
52
|
process.exit(command ? 0 : 1);
|
|
52
53
|
}
|
|
53
54
|
if (command === '--version' || command === '-v') {
|
|
54
|
-
console.log(
|
|
55
|
+
console.log(readPackageVersion());
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
58
|
if (!COMMANDS.has(command)) {
|
|
@@ -87,4 +88,13 @@ function printHelp() {
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
function readPackageVersion() {
|
|
92
|
+
const packageJsonPath = path.join(binRoot, '..', 'package.json');
|
|
93
|
+
try {
|
|
94
|
+
return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')).version || 'unknown';
|
|
95
|
+
} catch {
|
|
96
|
+
return 'unknown';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
90
100
|
main();
|