@potstackhub/poka 2.0.1 → 2.0.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.
Files changed (2) hide show
  1. package/npm/cli.js +12 -14
  2. package/package.json +6 -6
package/npm/cli.js CHANGED
@@ -26,20 +26,18 @@ const targetArch = archMap[arch] || 'x64';
26
26
  // Platform package name: @potstackhub/poka-linux-x64
27
27
  const platformPackage = `@potstackhub/poka-${targetPlatform}-${targetArch}`;
28
28
 
29
- // Try to find the binary in the platform package
30
- let binaryPath;
31
- try {
32
- // Check if platform package is installed
33
- const packagePath = path.join(__dirname, '../../node_modules', platformPackage, 'npm');
34
- const binaryName = platform === 'win32' ? 'poka.exe' : 'poka';
35
- binaryPath = path.join(packagePath, binaryName);
36
-
37
- if (!fs.existsSync(binaryPath)) {
38
- throw new Error(`Binary not found at ${binaryPath}`);
39
- }
40
- } catch (err) {
41
- console.error(`Error: Platform package not found for ${targetPlatform}-${targetArch}`);
42
- console.error(`Expected package: ${platformPackage}`);
29
+ // Find binary path
30
+ // __dirname is .../node_modules/@potstackhub/poka/npm
31
+ // Need to go up to package root, then into node_modules
32
+ const packageRoot = path.dirname(__dirname); // .../node_modules/@potstackhub/poka
33
+ const platformPkgPath = path.join(packageRoot, 'node_modules', platformPackage, 'npm');
34
+ const binaryName = platform === 'win32' ? 'poka.exe' : 'poka';
35
+ const binaryPath = path.join(platformPkgPath, binaryName);
36
+
37
+ if (!fs.existsSync(binaryPath)) {
38
+ console.error(`Error: Binary not found for ${targetPlatform}-${targetArch}`);
39
+ console.error(`Expected path: ${binaryPath}`);
40
+ console.error(`Platform package: ${platformPackage}`);
43
41
  console.error('');
44
42
  console.error('Please report this issue at: https://github.com/potstackhub/poka/issues');
45
43
  process.exit(1);
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@potstackhub/poka",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Tools for potstack software develop",
5
5
  "main": "npm/index.js",
6
6
  "bin": {
7
7
  "poka": "npm/cli.js"
8
8
  },
9
9
  "optionalDependencies": {
10
- "@potstackhub/poka-linux-x64": "2.0.0",
11
- "@potstackhub/poka-linux-arm64": "2.0.0",
12
- "@potstackhub/poka-darwin-x64": "2.0.0",
13
- "@potstackhub/poka-darwin-arm64": "2.0.0",
14
- "@potstackhub/poka-win32-x64": "2.0.0"
10
+ "@potstackhub/poka-linux-x64": "1.0.0",
11
+ "@potstackhub/poka-linux-arm64": "1.0.0",
12
+ "@potstackhub/poka-darwin-x64": "1.0.0",
13
+ "@potstackhub/poka-darwin-arm64": "1.0.0",
14
+ "@potstackhub/poka-win32-x64": "1.0.0"
15
15
  },
16
16
  "keywords": [
17
17
  "potstack",