diff options
-rw-r--r-- | manifests/drush.pp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/manifests/drush.pp b/manifests/drush.pp index 927b168..f7ef791 100644 --- a/manifests/drush.pp +++ b/manifests/drush.pp @@ -1,5 +1,6 @@ class drupal::drush( - $version = lookup('drupal::drush::version', undef, undef, '8.1.18') + $launcher = false, + $version = lookup('drupal::drush::version', undef, undef, '8.3.5') ) { # Drush config folder file { '/etc/drush': @@ -19,7 +20,6 @@ class drupal::drush( require => File['/etc/drush'], } - # TODO: future package { 'drush': ensure => absent, } @@ -48,9 +48,14 @@ class drupal::drush( # require => Exec['getcomposer'], #} + $download_url = $launcher ? { + true => "https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar", + false => "https://github.com/drush-ops/drush/releases/download/${version}/drush.phar", + } + exec { 'getdrush': #command => "/usr/bin/wget https://github.com/drush-ops/drush-launcher/releases/download/${version}/drush.phar -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush", - command => "/usr/bin/wget https://github.com/drush-ops/drush/releases/download/${version}/drush.phar -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush", + command => "/usr/bin/wget ${download_url} -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush", user => 'root', cwd => '/tmp', timeout => 0, |