@potstackhub/poka 2.0.2 → 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.
- package/npm/cli.js +12 -14
- package/package.json +1 -1
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
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
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);
|