public function cleanArchives($projectRoot, $maxAge = null, $keepMax = 10, $quiet = true) { return $this->cleanDirectory($projectRoot . '/' . $this->config->get('local.archive_dir'), $maxAge, $keepMax, [], $quiet); }
protected function execute(InputInterface $input, OutputInterface $output) { $projectRoot = $this->getProjectRoot(); if (!$projectRoot) { throw new RootNotFoundException(); } $builder = new LocalBuild(array(), $this->stdErr); $result = $builder->cleanBuilds($projectRoot, $input->getOption('max-age'), $input->getOption('keep'), $input->getOption('include-active'), false); if (!$result[0] && !$result[1]) { $this->stdErr->writeln("There are no builds to delete"); } else { if ($result[0]) { $this->stdErr->writeln("Deleted <info>{$result[0]}</info> build(s)"); } if ($result[1]) { $this->stdErr->writeln("Kept <info>{$result[1]}</info> build(s)"); } } $archivesResult = $builder->cleanArchives($projectRoot); if ($archivesResult[0]) { $this->stdErr->writeln("Deleted <info>{$archivesResult[0]}</info> archive(s)"); } }