mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-17 14:49:39 +08:00
.
This commit is contained in:
parent
cb6e9243c1
commit
21da3bebfb
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user