Fix using nodebb in other CWDs

This commit is contained in:
Peter Jaszkowiak
2017-04-12 15:22:58 -06:00
parent 73b6b06294
commit 75d291183d
6 changed files with 84 additions and 62 deletions

View File

@@ -2,6 +2,7 @@
(function (module) {
var fork = require('child_process').fork;
var path = require('path');
module.hash = function (rounds, password, callback) {
forkChild({ type: 'hash', rounds: rounds, password: password }, callback);
@@ -16,7 +17,7 @@
if (global.v8debug || parseInt(process.execArgv.indexOf('--debug'), 10) !== -1) {
forkProcessParams = { execArgv: ['--debug=' + (5859), '--nolazy'] };
}
var child = fork('./bcrypt', [], forkProcessParams);
var child = fork(path.join(__dirname, 'bcrypt'), [], forkProcessParams);
child.on('message', function (msg) {
if (msg.err) {