Skip to content

Commit bd2f7ce

Browse files
committed
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 <[email protected]>
1 parent eb885af commit bd2f7ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/models/revision.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var async = require('async')
55
var moment = require('moment')
66
var childProcess = require('child_process')
77
var shortId = require('shortid')
8+
var path = require('path')
89

910
// core
1011
var config = require('../config')
@@ -14,7 +15,7 @@ var dmpWorker = createDmpWorker()
1415
var dmpCallbackCache = {}
1516

1617
function createDmpWorker () {
17-
var worker = childProcess.fork('./lib/workers/dmpWorker.js', {
18+
var worker = childProcess.fork(path.resolve(__dirname, '../workers/dmpWorker.js'), {
1819
stdio: 'ignore'
1920
})
2021
if (config.debug) logger.info('dmp worker process started')

0 commit comments

Comments
 (0)