Skip to content

Commit 56d47ec

Browse files
committed
NodeJS port working properly.
1 parent 0d06c58 commit 56d47ec

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

source/ports/node_port/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
'use strict';
2222

2323
const Module = require('module');
24-
const Addon = require('./addon');
24+
const Path = require('path');
25+
const Addon = require(path.resolve(__dirname, './addon.js'));
2526

2627
const node_require = Module.prototype.require;
2728

source/ports/node_port/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "metacall",
3-
"version": "0.1.4",
3+
"version": "0.1.6",
44
"description": "Call Python, C#, Ruby... functions from NodeJS (a NodeJS Port for MetaCall)",
55
"repository": "github:metacall/core",
66
"bugs": "https://github.com/metacall/core/issues",

source/ports/node_port/scripts/preinstall.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
'use strict';
2222

23-
if (require('./addon') === undefined) {
24-
const path = require('path');
23+
const path = require('path');
24+
const addon = require(path.resolve(__dirname, '../addon.js'));
25+
26+
if (addon === undefined) {
2527
const fs = require('fs');
2628

2729
const basePath = '/gnu/store';
@@ -65,5 +67,5 @@ if (require('./addon') === undefined) {
6567
module.exports = '${folders[0]}/lib';
6668
`;
6769

68-
fs.writeFileSync('./installPath.js', script);
70+
fs.writeFileSync(path.resolve(__dirname, '../installPath.js'), script);
6971
}

0 commit comments

Comments
 (0)