@tanagram/cli 0.1.19 → 0.1.20
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/install.js +10 -3
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -24,9 +24,16 @@ async function buildWithGoBin() {
|
|
|
24
24
|
console.log('📦 Installing Go compiler via npm...');
|
|
25
25
|
|
|
26
26
|
try {
|
|
27
|
-
// Install Go using go-bin
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
// Install Go using go-bin
|
|
28
|
+
// Use require.resolve to find go-bin in node_modules
|
|
29
|
+
let goBin;
|
|
30
|
+
try {
|
|
31
|
+
goBin = require('go-bin');
|
|
32
|
+
} catch (err) {
|
|
33
|
+
// Fallback: try to require from parent node_modules
|
|
34
|
+
const parentPath = path.join(__dirname, '..', '..', 'go-bin');
|
|
35
|
+
goBin = require(parentPath);
|
|
36
|
+
}
|
|
30
37
|
const goDir = await goBin({ version: GO_VERSION, dir: __dirname });
|
|
31
38
|
const goPath = path.join(goDir, 'bin', 'go');
|
|
32
39
|
|