Skip to content

Commit 3d1bb8d

Browse files
committed
refs #45702, fixes drush command not in PATH
1 parent 2fb61d9 commit 3d1bb8d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

container/init-10.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@ cd $DRUPAL_ROOT
3232
if [ ! -f $DRUPAL_ROOT/sites/default/settings.php ]; then
3333
cd /var/www/html
3434
composer update "drupal/core-*" --with-all-dependencies
35+
36+
# correct drush installation
3537
composer require drush/drush
38+
39+
# add drush to PATH in bash.bashrc for future sessions
40+
if ! grep -q "/var/www/html/vendor/bin" /etc/bash.bashrc; then
41+
echo 'export PATH="/var/www/html/vendor/bin:$PATH"' >> /etc/bash.bashrc
42+
fi
43+
44+
# add drush to PATH for current script execution
45+
export PATH="/var/www/html/vendor/bin:$PATH"
46+
3647
echo "Install Drupal ..."
3748
date +"@ %Y-%m-%d %H:%M:%S %z"
3849
sleep 5s

0 commit comments

Comments
 (0)