You are here

function drush_minifyjs_minify_js in Minify JS 7

Same name and namespace in other branches
  1. 8 minifyjs.drush.inc \drush_minifyjs_minify_js()

Drush command logic. drush_[COMMAND_NAME]().

File

./minifyjs.drush.inc, line 40

Code

function drush_minifyjs_minify_js() {
  drush_print('Minifying all JS files...');
  module_load_include('inc', 'minifyjs', 'minifyjs.admin');
  $files = minifyjs_load_all_files();
  foreach ($files as $fid => $file) {
    $status = minifyjs_minify_file($fid);

    // Only output error messages.
    if ($status !== TRUE) {
      drush_print($status);
    }
  }
  cache_clear_all(MINIFYJS_CACHE_CID, 'cache');
  drush_print('Complete!');
}