hopcoderx-ai 1.0.92 → 1.0.94

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/hopcoderx CHANGED
@@ -168,10 +168,11 @@ function findBinary(startDir) {
168
168
 
169
169
  const resolved = findBinary(scriptDir)
170
170
  if (!resolved) {
171
+ const cmds = names.map((n) => ` npm install -g ${n}`).join("\n")
171
172
  console.error(
172
- "It seems that your package manager failed to install the right version of the hopcoderx CLI for your platform. You can try manually installing " +
173
- names.map((n) => `\"${n}\"`).join(" or ") +
174
- " package",
173
+ "It seems that your package manager failed to install the right version of the hopcoderx CLI for your platform.\n" +
174
+ "Run one of the following to fix it:\n" +
175
+ cmds,
175
176
  )
176
177
  process.exit(1)
177
178
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "hopcoderx-ai",
3
- "version": "1.0.92",
3
+ "version": "1.0.94",
4
4
  "description": "HopCoderX CLI - AI-powered development tool",
5
5
  "license": "MIT",
6
6
  "bin": { "hopcoderx": "./bin/hopcoderx" },
7
7
  "scripts": { "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs" },
8
- "optionalDependencies": {"hopcoderx-linux-x64-musl":"1.0.92","hopcoderx-windows-x64":"1.0.92","hopcoderx-linux-x64-baseline-musl":"1.0.92","hopcoderx-darwin-x64":"1.0.92","hopcoderx-linux-x64-baseline":"1.0.92","hopcoderx-windows-x64-baseline":"1.0.92","hopcoderx-linux-x64":"1.0.92","hopcoderx-darwin-arm64":"1.0.92","hopcoderx-darwin-x64-baseline":"1.0.92","hopcoderx-linux-arm64-musl":"1.0.92","hopcoderx-linux-arm64":"1.0.92"}
8
+ "optionalDependencies": {"hopcoderx-linux-x64-musl":"1.0.94","hopcoderx-windows-x64":"1.0.94","hopcoderx-linux-x64-baseline-musl":"1.0.94","hopcoderx-darwin-x64":"1.0.94","hopcoderx-linux-x64-baseline":"1.0.94","hopcoderx-windows-x64-baseline":"1.0.94","hopcoderx-linux-x64":"1.0.94","hopcoderx-darwin-arm64":"1.0.94","hopcoderx-darwin-x64-baseline":"1.0.94","hopcoderx-linux-arm64-musl":"1.0.94","hopcoderx-linux-arm64":"1.0.94"}
9
9
  }
package/postinstall.mjs CHANGED
@@ -99,26 +99,27 @@ function symlinkBinary(sourcePath, binaryName) {
99
99
 
100
100
  async function main() {
101
101
  try {
102
- if (os.platform() === "win32") {
103
- // On Windows, the .exe is already included in the package and bin field points to it
104
- // No postinstall setup needed
105
- console.log("Windows detected: binary setup not needed (using packaged .exe)")
106
- return
107
- }
108
-
109
- // On non-Windows platforms, just verify the binary package exists
110
- // Don't replace the wrapper script - it handles binary execution
102
+ const { platform, arch } = detectPlatformAndArch()
111
103
  const { binaryPath } = findBinary()
112
104
  const target = path.join(__dirname, "bin", ".hopcoderx")
113
105
  if (fs.existsSync(target)) fs.unlinkSync(target)
114
- try {
115
- fs.linkSync(binaryPath, target)
116
- } catch {
106
+ if (platform === "windows") {
107
+ // Windows: can't symlink without admin — copy instead
117
108
  fs.copyFileSync(binaryPath, target)
109
+ console.log(`hopcoderx binary cached at ${target}`)
110
+ } else {
111
+ try {
112
+ fs.linkSync(binaryPath, target)
113
+ } catch {
114
+ fs.copyFileSync(binaryPath, target)
115
+ }
116
+ fs.chmodSync(target, 0o755)
118
117
  }
119
- fs.chmodSync(target, 0o755)
120
118
  } catch (error) {
121
119
  console.error("Failed to setup hopcoderx binary:", error.message)
120
+ const { platform, arch } = detectPlatformAndArch()
121
+ const base = `hopcoderx-${platform}-${arch}`
122
+ console.error(`Fix: run npm install -g ${base} or npm install -g ${base}-baseline`)
122
123
  process.exit(1)
123
124
  }
124
125
  }