Some bug fixes in extensions
This commit is contained in:
1 parent
f6ad84c885
commit
b9e17c9add
3 files changed
+3
-3
No files matched your search
@@ -20,7 +20,7 @@ script = require("#{process.argv[2]}/#{process.argv[3]}")
|
||||
|
||||
|
||||
process.on('message', (message) ->
|
||||
script[message[1]](message.slice(2), (err, res) ->
|
||||
script[message[1][0]](message[1].slice(1), (err, res) ->
|
||||
throw err if err
|
||||
process.send([message[0], res])
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ messageHandler = (message) ->
|
||||
run = (args, callback) ->
|
||||
scriptName = args[0]
|
||||
if not processes[scriptName]?
|
||||
cwd = path.resolve(config.get('CONFIG_DIR'), 'extensions')
|
||||
cwd = path.resolve(config.get('CONFIG_DIR'), 'ext')
|
||||
p = childProcess.fork('lib/extension-wrapper', [cwd, scriptName])
|
||||
p.on('message', messageHandler)
|
||||
processes[scriptName] = p
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ Object.defineProperty(sandbox.context, 'ext', {value: () ->
|
||||
|
||||
extCall = (String(a) for a in arguments)
|
||||
key = JSON.stringify(extCall)
|
||||
if not sandbox.extensionsCache[sandbox.revision]?[key]?
|
||||
if not sandbox.extensionsCache[sandbox.revision]? or key not of sandbox.extensionsCache[sandbox.revision]
|
||||
sandbox.extensions = [extCall]
|
||||
throw new Exit()
|
||||
|
||||
|
||||
Reference in new issue
Block a user