omegon 0.6.14 → 0.6.15

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.
@@ -6,6 +6,9 @@
6
6
  */
7
7
 
8
8
  import { execSync } from "node:child_process";
9
+ import { existsSync } from "node:fs";
10
+ import { homedir } from "node:os";
11
+ import { join } from "node:path";
9
12
 
10
13
  export type DepTier = "core" | "recommended" | "optional";
11
14
 
@@ -37,6 +40,29 @@ export interface InstallOption {
37
40
  cmd: string;
38
41
  }
39
42
 
43
+ /**
44
+ * Ensure well-known tool paths are on PATH before probing.
45
+ *
46
+ * Tools installed by Nix, Cargo, etc. land in directories that may not be
47
+ * in the inherited PATH (e.g. Omegon launched from a shell that predates
48
+ * the install). We patch once at module load so every hasCmd() call sees them.
49
+ */
50
+ function ensureToolPaths(): void {
51
+ const home = homedir();
52
+ const dirs = [
53
+ "/nix/var/nix/profiles/default/bin",
54
+ join(home, ".nix-profile", "bin"),
55
+ join(home, ".cargo", "bin"),
56
+ ];
57
+ const current = process.env.PATH ?? "";
58
+ const parts = current.split(":");
59
+ const missing = dirs.filter(d => existsSync(d) && !parts.includes(d));
60
+ if (missing.length > 0) {
61
+ process.env.PATH = [...missing, current].join(":");
62
+ }
63
+ }
64
+ ensureToolPaths();
65
+
40
66
  function hasCmd(cmd: string): boolean {
41
67
  try {
42
68
  execSync(`which ${cmd}`, { stdio: "ignore" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omegon",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "description": "Omegon — an opinionated distribution of pi (by Mario Zechner) with extensions for lifecycle management, memory, orchestration, and visualization",
5
5
  "bin": {
6
6
  "omegon": "bin/omegon.mjs",