diff options
author | WilliButz | 2018-09-05 19:49:01 +0200 |
---|---|---|
committer | WilliButz | 2018-09-26 16:56:36 +0200 |
commit | bd2f7cef495b87050ec3f126e7425095078440b2 (patch) | |
tree | 157767942584b4c5b92c32b302baf10e831eadb1 /lib | |
parent | eb885af995d9756d2d24021ddaef5e748568b501 (diff) |
lib/models/revision.js: make independent of exec-path
Previously calling `app.js` from another directory than
the base directory of CodiMD would result in an error being
thrown because `lib/workers/dmpWorker.js` could not be found.
This change makes the function call independent of the path CodiMD
is started from.
Signed-off-by: WilliButz <wbutz@cyberfnord.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/models/revision.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/models/revision.js b/lib/models/revision.js index 8bc95cb1..4ee080da 100644 --- a/lib/models/revision.js +++ b/lib/models/revision.js @@ -5,6 +5,7 @@ var async = require('async') var moment = require('moment') var childProcess = require('child_process') var shortId = require('shortid') +var path = require('path') // core var config = require('../config') @@ -14,7 +15,7 @@ var dmpWorker = createDmpWorker() var dmpCallbackCache = {} function createDmpWorker () { - var worker = childProcess.fork('./lib/workers/dmpWorker.js', { + var worker = childProcess.fork(path.resolve(__dirname, '../workers/dmpWorker.js'), { stdio: 'ignore' }) if (config.debug) logger.info('dmp worker process started') |