diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/plugins/plugin-manager.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index eab0b3978..9086a4c8e 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts | |||
@@ -370,15 +370,17 @@ export class PluginManager implements ServerHook { | |||
370 | } catch (rootErr) { | 370 | } catch (rootErr) { |
371 | logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr }) | 371 | logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr }) |
372 | 372 | ||
373 | try { | 373 | if (npmName) { |
374 | await this.uninstall({ npmName }) | ||
375 | } catch (err) { | ||
376 | logger.error('Cannot uninstall plugin %s after failed installation.', toInstall, { err }) | ||
377 | |||
378 | try { | 374 | try { |
379 | await removeNpmPlugin(npmName) | 375 | await this.uninstall({ npmName }) |
380 | } catch (err) { | 376 | } catch (err) { |
381 | logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err }) | 377 | logger.error('Cannot uninstall plugin %s after failed installation.', toInstall, { err }) |
378 | |||
379 | try { | ||
380 | await removeNpmPlugin(npmName) | ||
381 | } catch (err) { | ||
382 | logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err }) | ||
383 | } | ||
382 | } | 384 | } |
383 | } | 385 | } |
384 | 386 | ||