fix: pass wrapper package root to codex installer

This commit is contained in:
YeonGyu-Kim
2026-05-31 00:12:46 +09:00
parent 64db15a6ac
commit a7715f1dc2
4 changed files with 53 additions and 7 deletions
+6
View File
@@ -6,6 +6,7 @@ import { spawnSync } from "node:child_process";
import { readFileSync } from "node:fs";
import { createRequire } from "node:module";
import { basename } from "node:path";
import { fileURLToPath } from "node:url";
import {
getPlatformPackageCandidates,
getBinaryPath,
@@ -90,6 +91,10 @@ function getWrapperPackageName() {
}
}
function getWrapperPackageRoot() {
return fileURLToPath(new URL("..", import.meta.url));
}
/**
* Determine which bin name the user invoked us with (oh-my-opencode, oh-my-openagent, omo, lazycodex).
* Propagated to the compiled CLI binary via OMO_INVOCATION_NAME so it can route accordingly
@@ -155,6 +160,7 @@ function main() {
const childEnv = {
...process.env,
OMO_INVOCATION_NAME: invocationName,
OMO_WRAPPER_PACKAGE_ROOT: getWrapperPackageRoot(),
};
for (let index = 0; index < resolvedBinaries.length; index += 1) {