mirror of https://github.com/Chocobozzz/PeerTube
Prevent uninstall error on install error
parent
1281e6a5f7
commit
f86ff3a026
|
@ -370,15 +370,17 @@ export class PluginManager implements ServerHook {
|
||||||
} catch (rootErr) {
|
} catch (rootErr) {
|
||||||
logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr })
|
logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr })
|
||||||
|
|
||||||
try {
|
if (npmName) {
|
||||||
await this.uninstall({ npmName })
|
|
||||||
} catch (err) {
|
|
||||||
logger.error('Cannot uninstall plugin %s after failed installation.', toInstall, { err })
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await removeNpmPlugin(npmName)
|
await this.uninstall({ npmName })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err })
|
logger.error('Cannot uninstall plugin %s after failed installation.', toInstall, { err })
|
||||||
|
|
||||||
|
try {
|
||||||
|
await removeNpmPlugin(npmName)
|
||||||
|
} catch (err) {
|
||||||
|
logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue