1
0
Fork 0

Rollback installation of plugins if corrupted, fixes #5130

pull/5150/head
Niels Keurentjes 2016-04-04 23:08:18 +02:00
parent bc1d92aeee
commit 63d3964ab5
1 changed files with 8 additions and 1 deletions

View File

@ -59,7 +59,14 @@ class PluginInstaller extends LibraryInstaller
}
parent::install($repo, $package);
$this->composer->getPluginManager()->registerPackage($package, true);
try {
$this->composer->getPluginManager()->registerPackage($package, true);
} catch(\Exception $e) {
// Rollback installation
$this->io->writeError('Plugin installation failed, rolling back');
parent::uninstall($repo, $package);
throw $e;
}
}
/**