aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-07-28 11:11:27 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-07-28 11:11:27 -0300
commite9fea4e089b5f94ff97afdf8725aaf3b92a86566 (patch)
treefa426bffed3d0966b34b0a2f2b8b020734689cbd
parent2b174b1d7724aef071a0c5bcaada88cf311f6e26 (diff)
downloadpuppet-drupal-e9fea4e089b5f94ff97afdf8725aaf3b92a86566.tar.gz
puppet-drupal-e9fea4e089b5f94ff97afdf8725aaf3b92a86566.tar.bz2
Adds drush wrapper
-rwxr-xr-xfiles/drush26
1 files changed, 26 insertions, 0 deletions
diff --git a/files/drush b/files/drush
new file mode 100755
index 0000000..cf9c353
--- /dev/null
+++ b/files/drush
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# A Drush wrapper.
+#
+# Legacy drush is based on system-wide installs, while recent versions support only
+# installations using composer:
+#
+# * https://docs.drush.org/en/master/install/
+# * https://docs.drush.org/en/8.x/install/
+#
+# This simple wrapper makes a system to support both at the same time by using a
+# simple heuristic: if there's a `vendor/drush` starting from the current folder,
+# then it uses drush-launcher, falling back to drush legacy otherwise.
+
+# Parameters
+BIN="/usr/local/bin"
+
+# Set drush implementation
+if [ ! -d "vendor/drush" ]; then
+ DRUSH="$BIN/drush-legacy"
+else
+ DRUSH="$BIN/drush-launcher"
+fi
+
+# Dispatch
+$DRUSH "$@"