Skip to content

Commit

Permalink
lib/models/revision.js: make independent of exec-path
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
WilliButz committed Sep 26, 2018
1 parent eb885af commit bd2f7ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/models/revision.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down

0 comments on commit bd2f7ce

Please sign in to comment.