function drush_make_generate

8.0.x generate.make.inc drush_make_generate($file = NULL)
6.x generate.make.inc drush_make_generate($file = NULL)
7.x generate.make.inc drush_make_generate($file = NULL)
5.x generate.make.inc drush_make_generate($file = NULL)
master generate.make.inc drush_make_generate($file = NULL)

Drush callback; generate makefile from the current build.

File

commands/make/generate.make.inc, line 13
Functions for the generate makefile command.

Code

function drush_make_generate($file = NULL) {
  $version_options = _drush_make_generate_get_version_options();
  $all_extensions = drush_get_extensions();
  list($projects, $libraries) = _drush_make_generate_projects($all_extensions, $version_options);
  $contents = _drush_make_generate_makefile_contents($projects, $libraries);

  if (!$file) {
    drush_print($contents);
  }
  elseif (file_put_contents($file, $contents)) {
    drush_log(dt("Wrote .make file @file", array('@file' => $file)), 'ok');
  }
  else {
    drush_make_error('FILE_ERROR', dt("Unable to write .make file !file", array('!file' => $file)));
  }
}