You are here

function patterns_drush_get_file_format in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns.drush.inc \patterns_drush_get_file_format()
2 calls to patterns_drush_get_file_format()
drush_patterns_quickrun in ./patterns.drush.inc
Runs a pattern file without importing it into the database
drush_patterns_run in ./patterns.drush.inc
Imports, enables, and runs the specified pattern file

File

./patterns.drush.inc, line 506
Drush Patterns module commands

Code

function patterns_drush_get_file_format($file, $format = PATTERNS_FORMAT_UNKNOWN) {
  $format = patterns_io_get_format_from_file($file, $format, FALSE);
  if (!$format) {
    $format = drush_prompt(dt("Unable to recognize the pattern format. Please specify it"));
    if (!patterns_parser_exists($format)) {
      return FALSE;
    }
  }
  return $format;
}