fix(#2849): resolve platform binaries using current package name
The installer wrapper and postinstall script still hardcoded the old oh-my-opencode-* platform package family. When users installed the renamed npm package oh-my-openagent (for example via npx oh-my-openagent install on WSL2/Linux), the main package installed correctly but the wrapper looked for nonexistent optional binaries like oh-my-opencode-linux-x64. Fix: - derive packageBaseName from package.json at runtime in wrapper/postinstall - thread packageBaseName through platform package candidate resolution - keep legacy oh-my-opencode default as fallback - add regression test for renamed package family
This commit is contained in:
@@ -22,15 +22,26 @@ function getLibcFamily() {
|
||||
}
|
||||
}
|
||||
|
||||
function getPackageBaseName() {
|
||||
try {
|
||||
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
||||
return packageJson.name || "oh-my-opencode";
|
||||
} catch {
|
||||
return "oh-my-opencode";
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const { platform, arch } = process;
|
||||
const libcFamily = getLibcFamily();
|
||||
const packageBaseName = getPackageBaseName();
|
||||
|
||||
try {
|
||||
const packageCandidates = getPlatformPackageCandidates({
|
||||
platform,
|
||||
arch,
|
||||
libcFamily,
|
||||
packageBaseName,
|
||||
});
|
||||
|
||||
const resolvedPackage = packageCandidates.find((pkg) => {
|
||||
|
||||
Reference in New Issue
Block a user