mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
Merge branch 'master' of github.com:Eugeny/terminus
This commit is contained in:
@@ -29,6 +29,6 @@ html
|
||||
div
|
||||
h1.terminus-title Terminus
|
||||
.progress
|
||||
.bar(style='width: 50%')
|
||||
.bar(style='width: 0%')
|
||||
|
||||
|
||||
|
@@ -21,7 +21,7 @@ if ((<any>global).require('electron-is-dev')) {
|
||||
}
|
||||
|
||||
findPlugins().then(async plugins => {
|
||||
let pluginsModules = loadPlugins(plugins, (current, total) => {
|
||||
let pluginsModules = await loadPlugins(plugins, (current, total) => {
|
||||
(<HTMLElement>document.querySelector('.progress .bar')).style.width = 100 * current / total + '%'
|
||||
})
|
||||
let module = await getRootModule(pluginsModules)
|
||||
|
@@ -62,10 +62,11 @@ export async function findPlugins (): Promise<IPluginEntry[]> {
|
||||
return foundPlugins
|
||||
}
|
||||
|
||||
export function loadPlugins (foundPlugins: IPluginEntry[], progress: ProgressCallback): any[] {
|
||||
export async function loadPlugins (foundPlugins: IPluginEntry[], progress: ProgressCallback): Promise<any[]> {
|
||||
let plugins: any[] = []
|
||||
progress(0, 1)
|
||||
foundPlugins.forEach((foundPlugin, index) => {
|
||||
let index = 0
|
||||
for (let foundPlugin of foundPlugins) {
|
||||
console.info(`Loading ${foundPlugin.name}: ${(<any>global).require.resolve(foundPlugin.path)}`)
|
||||
progress(index, foundPlugins.length)
|
||||
try {
|
||||
@@ -74,7 +75,9 @@ export function loadPlugins (foundPlugins: IPluginEntry[], progress: ProgressCal
|
||||
} catch (error) {
|
||||
console.error(`Could not load ${foundPlugin.name}:`, error)
|
||||
}
|
||||
})
|
||||
await delay(1)
|
||||
index++
|
||||
}
|
||||
progress(1, 1)
|
||||
return plugins
|
||||
}
|
||||
|
Reference in New Issue
Block a user