Skip to content

Commit 16632d6

Browse files
committed
Fixed drush version detection for Drush 7.
Drush 7 changed the default "--pipe" output format of drush core-status to JSON. Added "--format=list" and "--strict=0" to silence errors on drush versions not knowing about the "--format" option.
1 parent 866c3f4 commit 16632d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drupal-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Include path to the executable if it is not in your $PATH."
132132
"[\n\r]" ""
133133
(with-output-to-string
134134
(with-current-buffer standard-output
135-
(call-process drupal-drush-program nil (list t nil) nil "core-status" "drush-version" "--pipe")))))
135+
(call-process drupal-drush-program nil (list t nil) nil "core-status" "drush-version" "--pipe" "--format=list" "--strict=0")))))
136136
"Version number of the installed version Drush."
137137
:type 'string
138138
:link '(variable-link drupal-drush-program)
@@ -396,7 +396,7 @@ should save your files with unix style end of line."
396396
(php-search-documentation))
397397
((and drupal-drush-program (string-match "drush" (symbol-name symbol)))
398398
(browse-url
399-
(format-spec drupal-drush-search-url `((?v . ,(replace-regexp-in-string "\\([0-9]+\.\\).*\\'" "\\1x" drupal-drush-version))
399+
(format-spec drupal-drush-search-url `((?v . ,(replace-regexp-in-string "\\([0-9]+\.\\).*\\'" "\\1x" (replace-regexp-in-string ".*-dev" "master" drupal-drush-version)))
400400
(?s . ,symbol)))))
401401
(t (browse-url
402402
(format-spec drupal-search-url `((?v . ,(drupal-major-version drupal-version))

0 commit comments

Comments
 (0)