bincode-dev 0.0.16 → 0.0.17

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.
Files changed (2) hide show
  1. package/bin/bincode +20 -0
  2. package/package.json +5 -5
package/bin/bincode CHANGED
@@ -5,6 +5,26 @@ const fs = require("fs")
5
5
  const path = require("path")
6
6
  const os = require("os")
7
7
 
8
+ function printWrapperVersionAndExit() {
9
+ try {
10
+ const pkgPath = path.join(__dirname, "..", "package.json")
11
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"))
12
+ if (pkg && pkg.version) {
13
+ process.stdout.write(String(pkg.version) + "\n")
14
+ process.exit(0)
15
+ }
16
+ } catch {
17
+ // ignore
18
+ }
19
+ }
20
+
21
+ // Ensure `bincode -v/--version/version` always reports the wrapper npm package version,
22
+ // not whatever is embedded inside the native binary (which can be confusing during publishing tests).
23
+ const rawArgs = process.argv.slice(2)
24
+ if (rawArgs.includes("-v") || rawArgs.includes("--version") || rawArgs[0] === "version") {
25
+ printWrapperVersionAndExit()
26
+ }
27
+
8
28
  function run(target) {
9
29
  const env = { ...process.env }
10
30
  // Ensure this package variant uses its own config/data directories.
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "bincode-dev",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Bincode: AI-powered development CLI (dev/test version, not affiliated with opencode)",
5
5
  "bin": {
6
6
  "bincode": "./bin/bincode"
7
7
  },
8
8
  "optionalDependencies": {
9
- "bincode-dev-darwin-arm64": "0.0.16",
10
- "bincode-dev-darwin-x64": "0.0.16",
11
- "bincode-dev-linux-x64": "0.0.16",
12
- "bincode-dev-windows-x64": "0.0.16"
9
+ "bincode-dev-darwin-arm64": "0.0.17",
10
+ "bincode-dev-darwin-x64": "0.0.17",
11
+ "bincode-dev-linux-x64": "0.0.17",
12
+ "bincode-dev-windows-x64": "0.0.17"
13
13
  },
14
14
  "scripts": {
15
15
  "build": "bun script/build.ts",