You are here

function _dmu_ensure_directory in Drupal 7 to 8/9 Module Upgrader 8

Checks possible locations of a target module.

Ensures that at least one exists. If none do, sets an error.

Parameters

string $module: The target module's machine name.

1 call to _dmu_ensure_directory()
_dmu_validate_command in ./drupalmoduleupgrader.drush.inc
Validates any of the DMU commands.

File

./drupalmoduleupgrader.drush.inc, line 193
Declarations for Drush.

Code

function _dmu_ensure_directory($module) {
  $directory = _dmu_get_directory($module);
  if (empty($directory)) {
    if ($path = drush_get_option('path', NULL)) {
      drush_set_error('invalid_dir', 'Invalid path: ' . $path);
    }
    else {
      drush_set_error('no_directory', 'Cannot determine base directory of module ' . $module . '. Try passing --path=modules/foobar');
    }
  }
}