diff --git a/composer_manager.drush.inc b/composer_manager.drush.inc
index cf513f1..5676494 100644
--- a/composer_manager.drush.inc
+++ b/composer_manager.drush.inc
@@ -97,14 +97,34 @@ function drush_composer_manager_composer_json_rebuild() {
 /**
  * Drush hook; Called after a project is enabled.
  *
- * Rebuild and re-install the Composer dependencies.
+ * @see drush_composer_manager_write_if_changed()
  */
 function drush_composer_manager_post_pm_enable() {
-  // Ask whether to rebuild the Composer dependencies.
-  if (drush_confirm(dt('Build and install Composer dependencies?'))) {
-    // Rebuild the composer.json file.
-    if (drush_composer_manager_composer_json_rebuild()) {
-      // Run the Composer installation.
+  drush_composer_manager_write_if_changed();
+}
+
+/**
+ * Drush hook; Called after a project is disabled.
+ *
+ * @see drush_composer_manager_write_if_changed()
+ */
+function drush_composer_manager_post_pm_disable() {
+  drush_composer_manager_write_if_changed();
+}
+
+/**
+ * If one or more extensions being acted on contain a composer.json file, prompt
+ * the user to automatically run Composer's update command.
+ *
+ * @see composer_manager_write_if_changed()
+ * @see drush_composer_manager_post_pm_enable()
+ * @see drush_composer_manager_post_pm_disable()
+ */
+function drush_composer_manager_write_if_changed() {
+  $changed = &drupal_static('composer_manager_write_if_changed', FALSE);
+  if ($changed) {
+    drush_print('One or more extensions have dependencies managed by Composer.');
+    if (drush_confirm(dt('Update packages managed by Composer?'))) {
       drush_composer_manager('update');
     }
   }
diff --git a/composer_manager.module b/composer_manager.module
index e370f7b..9cda09f 100644
--- a/composer_manager.module
+++ b/composer_manager.module
@@ -61,14 +61,19 @@ function composer_manager_modules_disabled($modules) {
  * has a composer.json file.
  *
  * This is a primitive check to ensure that the composer.json file is built only
- * when it has changes.
+ * when it has changes. This check always passes when run via the command line,
+ * as it is assumed that Drush is being used to enable or disable the the
+ * modules. A static boolean is also set flagging whether one or more modules
+ * being acted on contains a composer.json file, which is used in Drush hooks.
  *
  * @param array $modules
  *   The enabled / disabled modules being scanned for a composer.json file.
  */
 function composer_manager_write_if_changed(array $modules) {
-  if (variable_get('composer_manager_autobuild_file', 1)) {
+  $changed = &drupal_static(__FUNCTION__, FALSE);
+  if (variable_get('composer_manager_autobuild_file', 1) || drupal_is_cli()) {
     if (composer_manager_has_composer_file($modules)) {
+      $changed = TRUE;
       composer_manager_write_file();
     }
   }
