This commit is contained in:
Eugene Pankov 2017-04-30 19:21:53 +02:00
parent cb6e9243c1
commit 21da3bebfb
2 changed files with 19 additions and 10 deletions

View File

@ -27,10 +27,6 @@ if (!process.env.TERMINUS_PLUGINS) {
process.env.TERMINUS_PLUGINS = ''
}
if (process.env.DEV) {
process.env.TERMINUS_PLUGINS += `:${path.resolve(__dirname, '..')}`
}
setupWindowManagement = () => {
let windowCloseable

View File

@ -12,12 +12,20 @@ function normalizePath (path: string): string {
};
(<any>global).require.main.paths.map(x => nodeModule.globalPaths.push(normalizePath(x)))
nodeModule.globalPaths.unshift(
path.join(
path.dirname(require('electron').remote.app.getPath('exe')),
'resources/builtin-plugins/node_modules',
)
)
if (process.env.DEV) {
nodeModule.globalPaths.unshift(path.dirname(require('electron').remote.app.getAppPath()))
}
nodeModule.globalPaths.unshift(path.join(
path.dirname(require('electron').remote.app.getPath('exe')),
'resources/builtin-plugins/node_modules',
))
nodeModule.globalPaths.unshift(path.join(
require('electron').remote.app.getPath('appData'),
'terminus',
'plugins',
))
if (process.env.TERMINUS_PLUGINS) {
process.env.TERMINUS_PLUGINS.split(':').map(x => nodeModule.globalPaths.unshift(normalizePath(x)))
@ -47,6 +55,11 @@ export async function findPlugins (): Promise<IPluginEntry[]> {
if (!await fs.exists(infoPath)) {
continue
}
if (foundPlugins.some(x => x.name === pluginName)) {
console.info(`Plugin ${pluginName} already exists`)
}
try {
foundPlugins.push({
name: pluginName,