Move code to new method cleanBackups()
parent
4b79ca6ba2
commit
496d29a793
|
@ -192,14 +192,7 @@ TAGSPUBKEY
|
||||||
|
|
||||||
// remove saved installations of composer
|
// remove saved installations of composer
|
||||||
if ($input->getOption('clean-backups')) {
|
if ($input->getOption('clean-backups')) {
|
||||||
$finder = $this->getOldInstallationFinder($rollbackDir);
|
$this->cleanBackups($rollbackDir);
|
||||||
|
|
||||||
$fs = new Filesystem;
|
|
||||||
foreach ($finder as $file) {
|
|
||||||
$file = (string) $file;
|
|
||||||
$io->writeError('<info>Removing: '.$file.'</info>');
|
|
||||||
$fs->remove($file);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($err = $this->setLocalPhar($localFilename, $tempFilename, $backupFile)) {
|
if ($err = $this->setLocalPhar($localFilename, $tempFilename, $backupFile)) {
|
||||||
|
@ -322,6 +315,19 @@ TAGSPUBKEY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function cleanBackups($rollbackDir)
|
||||||
|
{
|
||||||
|
$finder = $this->getOldInstallationFinder($rollbackDir);
|
||||||
|
$io = $this->getIO();
|
||||||
|
$fs = new Filesystem;
|
||||||
|
|
||||||
|
foreach ($finder as $file) {
|
||||||
|
$file = (string) $file;
|
||||||
|
$io->writeError('<info>Removing: '.$file.'</info>');
|
||||||
|
$fs->remove($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected function getLastBackupVersion($rollbackDir)
|
protected function getLastBackupVersion($rollbackDir)
|
||||||
{
|
{
|
||||||
$finder = $this->getOldInstallationFinder($rollbackDir);
|
$finder = $this->getOldInstallationFinder($rollbackDir);
|
||||||
|
|
Loading…
Reference in New Issue