aboutsummaryrefslogtreecommitdiff
path: root/files/drush
blob: cf9c353af1c5b5848c2f92eb7306c8e9955b4d63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 "$@"