Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 0cfd526

Browse files
committed
Fixes #1590: blt doctor only returns error output.
1 parent a9242f8 commit 0cfd526

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

scripts/drupal-vm/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ drupal_build_composer_project: false
2525
drupal_build_composer: false
2626
drupal_composer_path: false
2727
drupal_composer_install_dir: "/var/www/${project.machine_name}"
28-
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
28+
drupal_core_path: "/var/www/${project.machine_name}/docroot"
2929
ssh_home: /var/www/${project.machine_name}
3030

3131
drupal_db_user: drupal

src/Robo/Commands/Blt/DoctorCommand.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ public function doctor() {
6060
* The command result.
6161
*/
6262
protected function executeDoctorInsideVm() {
63-
$drupal_vm_config = Yaml::parse(file_get_contents($this->getConfigValue('repo.root') . '/box/config.yml'));
64-
$repo_root = $drupal_vm_config['vagrant_synced_folders'][0]['destination'];
63+
$drupal_vm_config_filepath = $this->getConfigValue('repo.root') . '/box/config.yml';
64+
$drupal_vm_config = Yaml::parse(file_get_contents($drupal_vm_config_filepath));
65+
$repo_root = $drupal_vm_config['drupal_core_path'];
66+
if (strstr($repo_root, '{{')) {
67+
throw new \Exception("The value of drupal_core_path in $drupal_vm_config_filepath contains an unresolved Ansible variable. Please do not use variable placeholders for drupal_core_path. BLT cannot resolve them.");
68+
}
69+
6570
$this->say("Drupal VM was detected. Running blt doctor inside of VM...");
6671
$command = "cd $repo_root && $repo_root/vendor/bin/drush cc drush && $repo_root/vendor/bin/drush --include=$repo_root/vendor/acquia/blt/drush blt-doctor -r $repo_root/docroot";
6772

0 commit comments

Comments
 (0)