Skip to content

Commit

Permalink
Have console tool clear new temporary cache files too.
Browse files Browse the repository at this point in the history
The clear command should clear all the temp files too. Its only polite
really.
  • Loading branch information
markstory committed Oct 19, 2014
1 parent 9bd65b5 commit a6773ec
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Console/Command/AssetCompressShell.php
Expand Up @@ -113,11 +113,25 @@ protected function _clearBuilds($ext) {
$this->err('No ' . $ext . ' build files defined, skipping');
return;
}
$this->_clearPath(TMP, $themes, $targets);

$path = $this->_Config->cachePath($ext);
if (!file_exists($path)) {
$this->err('Build directory ' . $path . ' for ' . $ext . ' does not exist.');
return;
}
$this->_clearPath($path, $themes, $targets);
}

/**
* Clear a path of build targets.
*
* @param string $path The path to clear.
* @param array $themes The themes to clear.
* @param array $targets The build targets to clear.
* @return void
*/
protected function _clearPath($path, $themes, $targets) {
$dir = new DirectoryIterator($path);
foreach ($dir as $file) {
$name = $base = $file->getFilename();
Expand Down

0 comments on commit a6773ec

Please sign in to comment.