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/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();