@hbarefoot/engram 1.4.1 → 1.4.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="https://raw.githubusercontent.com/HBarefoot/engram/main/engram-logo.png" alt="Engram" width="32" height="32" style="vertical-align: middle;" /> Engram
1
+ # ![Engram](https://raw.githubusercontent.com/HBarefoot/engram/main/engram-logo.png) Engram
2
2
 
3
3
  [![CI](https://github.com/HBarefoot/engram/actions/workflows/ci.yml/badge.svg)](https://github.com/HBarefoot/engram/actions/workflows/ci.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/@hbarefoot/engram)](https://www.npmjs.com/package/@hbarefoot/engram)
package/bin/engram.js CHANGED
@@ -16,17 +16,19 @@ import { fileURLToPath } from 'url';
16
16
  import { dirname, join } from 'path';
17
17
  import fs from 'fs';
18
18
 
19
- // Read version from package.json (may not exist when running as bundled sidecar)
19
+ // Read version: prefer build-time define, then package.json, then fallback
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = dirname(__filename);
22
- let version = '1.1.0';
23
- try {
24
- const packageJson = JSON.parse(
25
- readFileSync(join(__dirname, '../package.json'), 'utf-8')
26
- );
27
- version = packageJson.version;
28
- } catch {
29
- // Running as bundled sidecar — package.json not available
22
+ let version = process.env.ENGRAM_VERSION || 'unknown';
23
+ if (version === 'unknown') {
24
+ try {
25
+ const packageJson = JSON.parse(
26
+ readFileSync(join(__dirname, '../package.json'), 'utf-8')
27
+ );
28
+ version = packageJson.version;
29
+ } catch {
30
+ // Running as bundled sidecar — package.json not available
31
+ }
30
32
  }
31
33
 
32
34
  const program = new Command();