function SelfUpdateCommand::cleanBackups
1 call to SelfUpdateCommand::cleanBackups()
- SelfUpdateCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ SelfUpdateCommand.php
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ SelfUpdateCommand.php, line 499
Class
- SelfUpdateCommand
- @author Igor Wiedler <igor@wiedler.ch> @author Kevin Ran <kran@adobe.com> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\CommandCode
protected function cleanBackups(string $rollbackDir, ?string $except = null) : void {
$finder = $this->getOldInstallationFinder($rollbackDir);
$io = $this->getIO();
$fs = new Filesystem();
foreach ($finder as $file) {
if ($file->getBasename(self::OLD_INSTALL_EXT) === $except) {
continue;
}
$file = (string) $file;
$io->writeError('<info>Removing: ' . $file . '</info>');
$fs->remove($file);
}
}