public function fire()
{
// Get directory paths
$pipeDir = Config::get('assets::pipeline_dir', 'min');
$cssDir = public_path(Config::get('assets::css_dir', 'css') . DIRECTORY_SEPARATOR . $pipeDir);
$jsDir = public_path(Config::get('assets::js_dir', 'js') . DIRECTORY_SEPARATOR . $pipeDir);
// Ask for confirmation
if (!$this->option('force')) {
$this->info(sprintf('All content of %s and %s will be deleted.', $cssDir, $jsDir));
if (!$this->confirm('Do you wish to continue? [yes|no]')) {
return;
}
}
// Purge assets
$purgeCss = $this->purgeDir($cssDir);
$purgeJs = $this->purgeDir($jsDir);
if (!$purgeCss or !$purgeJs) {
return $this->error('Something went wrong');
}
$this->info('Done!');
}