aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/plugins/plugin-manager.ts')
-rw-r--r--server/lib/plugins/plugin-manager.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts
index a706df1e0..a46b97fa4 100644
--- a/server/lib/plugins/plugin-manager.ts
+++ b/server/lib/plugins/plugin-manager.ts
@@ -3,6 +3,7 @@ import { createReadStream, createWriteStream } from 'fs'
3import { ensureDir, outputFile, readJSON } from 'fs-extra' 3import { ensureDir, outputFile, readJSON } from 'fs-extra'
4import { basename, join } from 'path' 4import { basename, join } from 'path'
5import { decachePlugin } from '@server/helpers/decache' 5import { decachePlugin } from '@server/helpers/decache'
6import { ApplicationModel } from '@server/models/application/application'
6import { MOAuthTokenUser, MUser } from '@server/types/models' 7import { MOAuthTokenUser, MUser } from '@server/types/models'
7import { getCompleteLocale } from '@shared/core-utils' 8import { getCompleteLocale } from '@shared/core-utils'
8import { 9import {
@@ -23,7 +24,7 @@ import { PluginModel } from '../../models/server/plugin'
23import { PluginLibrary, RegisterServerAuthExternalOptions, RegisterServerAuthPassOptions, RegisterServerOptions } from '../../types/plugins' 24import { PluginLibrary, RegisterServerAuthExternalOptions, RegisterServerAuthPassOptions, RegisterServerOptions } from '../../types/plugins'
24import { ClientHtml } from '../client-html' 25import { ClientHtml } from '../client-html'
25import { RegisterHelpers } from './register-helpers' 26import { RegisterHelpers } from './register-helpers'
26import { installNpmPlugin, installNpmPluginFromDisk, removeNpmPlugin } from './yarn' 27import { installNpmPlugin, installNpmPluginFromDisk, rebuildNativePlugins, removeNpmPlugin } from './yarn'
27 28
28export interface RegisteredPlugin { 29export interface RegisteredPlugin {
29 npmName: string 30 npmName: string
@@ -384,6 +385,12 @@ export class PluginManager implements ServerHook {
384 logger.info('Plugin %s uninstalled.', npmName) 385 logger.info('Plugin %s uninstalled.', npmName)
385 } 386 }
386 387
388 async rebuildNativePluginsIfNeeded () {
389 if (!await ApplicationModel.nodeABIChanged()) return
390
391 return rebuildNativePlugins()
392 }
393
387 // ###################### Private register ###################### 394 // ###################### Private register ######################
388 395
389 private async registerPluginOrTheme (plugin: PluginModel) { 396 private async registerPluginOrTheme (plugin: PluginModel) {