Skip to content

Commit

Permalink
Issue #9: Get the docroot dir from env variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
elvism-lullabot committed Jul 24, 2024
1 parent 6ebb053 commit 21e9d60
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion bin/drush-playwright-internal
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,25 @@ if (!$test_id) {
exit(1);
}

include_once '/var/www/html/web/core/includes/bootstrap.inc';
// Get the docroot directory from the environment variable.
$docroot_dir = getenv('DOCROOT');
if (!$docroot_dir) {
print "DOCROOT must be defined as an environment variable.";
exit(1);
}

// Construct the path to the bootstrap.inc file based on the docroot directory.
$bootstrap_path = "/var/www/html/$docroot_dir/core/includes/bootstrap.inc";

// Check if the file exists and include it.
if (file_exists($bootstrap_path)) {
include_once $bootstrap_path;
}
else {
print "bootstrap.inc file not found in the specified directory.";
exit(1);
}

drupal_valid_test_ua('test' . $test_id);

return include '/var/www/html/vendor/bin/drush';

0 comments on commit 21e9d60

Please sign in to comment.