From c0998761c0ca9bf8fbed11e0f3a4c6689b0df1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Ara=C3=B1a=20Cruz?= Date: Thu, 19 Nov 2015 11:46:01 +0000 Subject: [PATCH] Drupal 8: Refresh module cache after downloading new modules. Fixes #5. --- commands/pm/pm.drush.inc | 4 ++++ lib/Drush/Drupal/ExtensionDiscovery.php | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 lib/Drush/Drupal/ExtensionDiscovery.php diff --git a/commands/pm/pm.drush.inc b/commands/pm/pm.drush.inc index 332150d749..1c5e7ebb04 100644 --- a/commands/pm/pm.drush.inc +++ b/commands/pm/pm.drush.inc @@ -1030,6 +1030,10 @@ function drush_pm_enable_validate() { // Restore DRUSH_AFFIRMATIVE context. drush_set_context('DRUSH_AFFIRMATIVE', $drush_affirmative); // Refresh module cache after downloading the new modules. + if (drush_drupal_major_version() >= 8) { + \Drush\Drupal\ExtensionDiscovery::reset(); + system_list_reset(); + } $extension_info = drush_get_extensions(); $recheck = TRUE; } diff --git a/lib/Drush/Drupal/ExtensionDiscovery.php b/lib/Drush/Drupal/ExtensionDiscovery.php new file mode 100644 index 0000000000..1fbc51c1c5 --- /dev/null +++ b/lib/Drush/Drupal/ExtensionDiscovery.php @@ -0,0 +1,12 @@ +