@potstackhub/poka 2.0.2 → 2.0.4

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 +5 -5
  2. package/package.json +1 -1
package/npm/cli.js CHANGED
@@ -26,13 +26,12 @@ 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
29
+ // Try to find platform package using require.resolve
30
30
  let binaryPath;
31
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);
32
+ // This resolves to the platform package's directory
33
+ const platformPkgDir = path.dirname(require.resolve(`${platformPackage}/package.json`));
34
+ binaryPath = path.join(platformPkgDir, 'npm', platform === 'win32' ? 'poka.exe' : 'poka');
36
35
 
37
36
  if (!fs.existsSync(binaryPath)) {
38
37
  throw new Error(`Binary not found at ${binaryPath}`);
@@ -40,6 +39,7 @@ try {
40
39
  } catch (err) {
41
40
  console.error(`Error: Platform package not found for ${targetPlatform}-${targetArch}`);
42
41
  console.error(`Expected package: ${platformPackage}`);
42
+ console.error(`Details: ${err.message}`);
43
43
  console.error('');
44
44
  console.error('Please report this issue at: https://github.com/potstackhub/poka/issues');
45
45
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@potstackhub/poka",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Tools for potstack software develop",
5
5
  "main": "npm/index.js",
6
6
  "bin": {