oh-my-opencode-unguarded 3.9.2 → 3.9.3
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/LICENSE.md +82 -82
- package/README.ja.md +347 -347
- package/README.ko.md +346 -346
- package/README.md +43 -43
- package/README.ru.md +367 -367
- package/README.zh-cn.md +346 -346
- package/bin/oh-my-opencode.js +142 -142
- package/bin/platform.d.ts +14 -14
- package/bin/platform.js +82 -82
- package/bin/platform.test.ts +203 -203
- package/dist/cli/index.js +1 -1
- package/package.json +99 -99
- package/postinstall.mjs +59 -59
package/postinstall.mjs
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
// postinstall.mjs
|
|
2
|
-
// Runs after npm install to verify platform binary is available
|
|
3
|
-
|
|
4
|
-
import { createRequire } from "node:module";
|
|
5
|
-
import { getPlatformPackageCandidates, getBinaryPath } from "./bin/platform.js";
|
|
6
|
-
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Detect libc family on Linux
|
|
11
|
-
*/
|
|
12
|
-
function getLibcFamily() {
|
|
13
|
-
if (process.platform !== "linux") {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
const detectLibc = require("detect-libc");
|
|
19
|
-
return detectLibc.familySync();
|
|
20
|
-
} catch {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function main() {
|
|
26
|
-
const { platform, arch } = process;
|
|
27
|
-
const libcFamily = getLibcFamily();
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const packageCandidates = getPlatformPackageCandidates({
|
|
31
|
-
platform,
|
|
32
|
-
arch,
|
|
33
|
-
libcFamily,
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const resolvedPackage = packageCandidates.find((pkg) => {
|
|
37
|
-
try {
|
|
38
|
-
require.resolve(getBinaryPath(pkg, platform));
|
|
39
|
-
return true;
|
|
40
|
-
} catch {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
if (!resolvedPackage) {
|
|
46
|
-
throw new Error(
|
|
47
|
-
`No platform binary package installed. Tried: ${packageCandidates.join(", ")}`
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
console.log(`✓ oh-my-opencode binary installed for ${platform}-${arch} (${resolvedPackage})`);
|
|
52
|
-
} catch (error) {
|
|
53
|
-
console.warn(`⚠ oh-my-opencode: ${error.message}`);
|
|
54
|
-
console.warn(` The CLI may not work on this platform.`);
|
|
55
|
-
// Don't fail installation - let user try anyway
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
main();
|
|
1
|
+
// postinstall.mjs
|
|
2
|
+
// Runs after npm install to verify platform binary is available
|
|
3
|
+
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { getPlatformPackageCandidates, getBinaryPath } from "./bin/platform.js";
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Detect libc family on Linux
|
|
11
|
+
*/
|
|
12
|
+
function getLibcFamily() {
|
|
13
|
+
if (process.platform !== "linux") {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const detectLibc = require("detect-libc");
|
|
19
|
+
return detectLibc.familySync();
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function main() {
|
|
26
|
+
const { platform, arch } = process;
|
|
27
|
+
const libcFamily = getLibcFamily();
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const packageCandidates = getPlatformPackageCandidates({
|
|
31
|
+
platform,
|
|
32
|
+
arch,
|
|
33
|
+
libcFamily,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const resolvedPackage = packageCandidates.find((pkg) => {
|
|
37
|
+
try {
|
|
38
|
+
require.resolve(getBinaryPath(pkg, platform));
|
|
39
|
+
return true;
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (!resolvedPackage) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`No platform binary package installed. Tried: ${packageCandidates.join(", ")}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(`✓ oh-my-opencode binary installed for ${platform}-${arch} (${resolvedPackage})`);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.warn(`⚠ oh-my-opencode: ${error.message}`);
|
|
54
|
+
console.warn(` The CLI may not work on this platform.`);
|
|
55
|
+
// Don't fail installation - let user try anyway
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main();
|