opencode-ai 0.6.5 → 0.6.6
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/bin/opencode.cmd +4 -2
- package/package.json +9 -8
- package/postinstall.mjs +5 -0
- package/preinstall.mjs +32 -0
package/bin/opencode.cmd
CHANGED
|
@@ -52,5 +52,7 @@ echo It seems that your package manager failed to install the right version of t
|
|
|
52
52
|
exit /b 1
|
|
53
53
|
|
|
54
54
|
:execute
|
|
55
|
-
rem Execute the binary with all arguments
|
|
56
|
-
|
|
55
|
+
rem Execute the binary with all arguments in the same console window
|
|
56
|
+
rem Use start /b /wait to ensure it runs in the current shell context for all shells
|
|
57
|
+
start /b /wait "" "%resolved%" %*
|
|
58
|
+
exit /b %ERRORLEVEL%
|
package/package.json
CHANGED
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
"opencode": "./bin/opencode"
|
|
5
5
|
},
|
|
6
6
|
"scripts": {
|
|
7
|
+
"preinstall": "node ./preinstall.mjs",
|
|
7
8
|
"postinstall": "node ./postinstall.mjs"
|
|
8
9
|
},
|
|
9
|
-
"version": "0.6.
|
|
10
|
+
"version": "0.6.6",
|
|
10
11
|
"optionalDependencies": {
|
|
11
|
-
"opencode-windows-x64": "0.6.
|
|
12
|
-
"opencode-linux-arm64": "0.6.
|
|
13
|
-
"opencode-linux-x64": "0.6.
|
|
14
|
-
"opencode-linux-x64-baseline": "0.6.
|
|
15
|
-
"opencode-darwin-x64": "0.6.
|
|
16
|
-
"opencode-darwin-x64-baseline": "0.6.
|
|
17
|
-
"opencode-darwin-arm64": "0.6.
|
|
12
|
+
"opencode-windows-x64": "0.6.6",
|
|
13
|
+
"opencode-linux-arm64": "0.6.6",
|
|
14
|
+
"opencode-linux-x64": "0.6.6",
|
|
15
|
+
"opencode-linux-x64-baseline": "0.6.6",
|
|
16
|
+
"opencode-darwin-x64": "0.6.6",
|
|
17
|
+
"opencode-darwin-x64-baseline": "0.6.6",
|
|
18
|
+
"opencode-darwin-arm64": "0.6.6"
|
|
18
19
|
}
|
|
19
20
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -70,6 +70,11 @@ function findBinary() {
|
|
|
70
70
|
|
|
71
71
|
function main() {
|
|
72
72
|
try {
|
|
73
|
+
if (os.platform() === "win32") {
|
|
74
|
+
console.log("Windows detected, skipping postinstall")
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
const binaryPath = findBinary()
|
|
74
79
|
const binScript = path.join(__dirname, "bin", "opencode")
|
|
75
80
|
|
package/preinstall.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "fs"
|
|
4
|
+
import path from "path"
|
|
5
|
+
import os from "os"
|
|
6
|
+
import { fileURLToPath } from "url"
|
|
7
|
+
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
9
|
+
|
|
10
|
+
function main() {
|
|
11
|
+
if (os.platform() !== "win32") {
|
|
12
|
+
console.log("Non-Windows platform detected, skipping preinstall")
|
|
13
|
+
return
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const binDir = path.join(__dirname, "bin")
|
|
17
|
+
const unixScript = path.join(binDir, "opencode")
|
|
18
|
+
|
|
19
|
+
console.log("Windows detected: Configuring bin scripts for Windows")
|
|
20
|
+
|
|
21
|
+
if (fs.existsSync(unixScript)) {
|
|
22
|
+
console.log("Removing Unix shell script from bin/")
|
|
23
|
+
fs.unlinkSync(unixScript)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
main()
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error("Preinstall script error:", error.message)
|
|
31
|
+
process.exit(0)
|
|
32
|
+
}
|