mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-05-18 00:52:31 +08:00
23 lines
533 B
CoffeeScript
23 lines
533 B
CoffeeScript
path = require 'path'
|
|
|
|
i18n = require './i18n'
|
|
config = require './config'
|
|
|
|
exports.get = (name) ->
|
|
return require path.join(__dirname, "../plugin/#{name}")
|
|
|
|
exports.loadPlugins = (app) ->
|
|
for name in config.plugin.availablePlugin
|
|
i18n.loadPlugin path.join(__dirname, "../plugin/#{name}/locale"), name
|
|
|
|
plugin = exports.get name
|
|
|
|
if plugin.action
|
|
app.use ('/plugin/' + name), plugin.action
|
|
|
|
exports.systemOperate = (operator, callback) ->
|
|
if config.debug.mock_test
|
|
callback()
|
|
else
|
|
operator callback
|