0byte-opencode 1.4.3-66i7dk29 → 1.4.11-plugin-fix
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/package.json +4 -4
- package/postinstall.mjs +2 -31
package/package.json
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
8
8
|
},
|
|
9
|
-
"version": "1.4.
|
|
9
|
+
"version": "1.4.11-plugin-fix",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"0byte-opencode-linux-x64-baseline-musl": "1.4.
|
|
13
|
-
"0byte-opencode-linux-x64-baseline": "1.4.
|
|
14
|
-
"0byte-opencode-linux-x64": "1.4.
|
|
12
|
+
"0byte-opencode-linux-x64-baseline-musl": "1.4.11-plugin-fix",
|
|
13
|
+
"0byte-opencode-linux-x64-baseline": "1.4.11-plugin-fix",
|
|
14
|
+
"0byte-opencode-linux-x64": "1.4.11-plugin-fix"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -64,36 +64,7 @@ function findBinary() {
|
|
|
64
64
|
|
|
65
65
|
return { binaryPath, binaryName }
|
|
66
66
|
} catch (error) {
|
|
67
|
-
throw new Error(`Could not find package ${packageName}: ${error.message}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function prepareBinDirectory(binaryName) {
|
|
72
|
-
const binDir = path.join(__dirname, "bin")
|
|
73
|
-
const targetPath = path.join(binDir, binaryName)
|
|
74
|
-
|
|
75
|
-
// Ensure bin directory exists
|
|
76
|
-
if (!fs.existsSync(binDir)) {
|
|
77
|
-
fs.mkdirSync(binDir, { recursive: true })
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Remove existing binary/symlink if it exists
|
|
81
|
-
if (fs.existsSync(targetPath)) {
|
|
82
|
-
fs.unlinkSync(targetPath)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return { binDir, targetPath }
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function symlinkBinary(sourcePath, binaryName) {
|
|
89
|
-
const { targetPath } = prepareBinDirectory(binaryName)
|
|
90
|
-
|
|
91
|
-
fs.symlinkSync(sourcePath, targetPath)
|
|
92
|
-
console.log(`opencode binary symlinked: ${targetPath} -> ${sourcePath}`)
|
|
93
|
-
|
|
94
|
-
// Verify the file exists after operation
|
|
95
|
-
if (!fs.existsSync(targetPath)) {
|
|
96
|
-
throw new Error(`Failed to symlink binary to ${targetPath}`)
|
|
67
|
+
throw new Error(`Could not find package ${packageName}: ${error.message}`, { cause: error })
|
|
97
68
|
}
|
|
98
69
|
}
|
|
99
70
|
|
|
@@ -124,7 +95,7 @@ async function main() {
|
|
|
124
95
|
}
|
|
125
96
|
|
|
126
97
|
try {
|
|
127
|
-
main()
|
|
98
|
+
void main()
|
|
128
99
|
} catch (error) {
|
|
129
100
|
console.error("Postinstall script error:", error.message)
|
|
130
101
|
process.exit(0)
|