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

Commit 6f27233

Browse files
authored
Fixes #1328: Spaces in project paths break BLT. (#1426)
* Fixes #1328: Spaces in project paths break BLT. * A few more fixes.
1 parent 7416a46 commit 6f27233

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

phing/tasks/properties.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<exec dir="${repo.root}" command="echo '0' >> ${blt.config-files.schema-version}" checkreturn="true" logoutput="true" passthru="false" level="${blt.exec_level}"/>
4040
</then>
4141
</if>
42-
<exec dir="${repo.root}" command="cat ${blt.config-files.schema-version}" outputProperty="blt.schema-version" checkreturn="true" logoutput="false" level="${blt.exec_level}"/>
42+
<exec dir="${repo.root}" command="cat '${blt.config-files.schema-version}'" outputProperty="blt.schema-version" checkreturn="true" logoutput="false" level="${blt.exec_level}"/>
4343
<!-- Send errors to /dev/null, for environments like ACE without composer. -->
4444
<exec dir="${repo.root}" command="composer info acquia/blt --no-ansi 2> /dev/null | grep versions | awk '{print $4}'" outputProperty="blt.version" logoutput="false" checkreturn="true" level="${blt.exec_level}" />
4545

src/Robo/Commands/Blt/DoctorCommand.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ protected function executeDoctorInsideVm() {
6868
* The command result.
6969
*/
7070
protected function executeDoctorOnHost($alias) {
71-
$include_dir = $this->getConfigValue('blt.root') . '/drush';
7271
$result = $this->taskDrush()
7372
->drush("blt-doctor")
7473
->alias($alias)
7574
->uri("")
76-
->includePath($include_dir)
75+
->includePath($this->getConfigValue('blt.root') . '/drush')
7776
->run();
7877

7978
return $result;

src/Robo/Commands/Tests/BehatCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ protected function launchPhantomJs() {
171171
}
172172
$this->killPhantomJs();
173173
$this->say("Launching PhantomJS GhostDriver.");
174-
$this->taskExec("{$this->getConfigValue('composer.bin')}/phantomjs")
174+
$this->taskExec("'{$this->getConfigValue('composer.bin')}/phantomjs'")
175175
->option("webdriver", 4444)
176176
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
177177
->background()

src/Robo/Common/Executor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function drush($command) {
8080
if (!empty($drush_alias)) {
8181
$drush_alias = "@$drush_alias";
8282
}
83-
$process_executor = Robo::process(new Process("$bin/drush $drush_alias $command"));
83+
$process_executor = Robo::process(new Process("'$bin/drush' $drush_alias $command"));
8484
return $process_executor->dir($this->getConfigValue('docroot'))
8585
->interactive(FALSE)
8686
->printOutput(FALSE)

src/Robo/Tasks/DrushTask.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ public function includePath($path) {
200200
* Sets up drush defaults using config.
201201
*/
202202
protected function init() {
203-
$this->executable = $this->getConfig()->get('drush.bin') ?: 'drush';
203+
if ($this->getConfig()->get('drush.bin')) {
204+
$this->executable = str_replace(' ', '\\ ', $this->getConfig()->get('drush.bin'));
205+
}
206+
else {
207+
$this->executable = 'drush';
208+
}
209+
204210
if (!isset($this->dir)) {
205211
$this->dir($this->getConfig()->get('drush.dir'));
206212
}

template/drush.wrapper

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
# `../vendor/bin/drush.launcher --local $@` is a common variant for
2929
# composer-managed Drupal sites.
3030
#
31-
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
31+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3232
cd "`dirname $0`"
3333

34-
if [ ! -f ${DIR}/vendor/drush/drush/drush.launcher ]; then
34+
if [ ! -f "${DIR}/vendor/drush/drush/drush.launcher" ]; then
3535
echo >&2 "Drush was not found in this project's vendor directory. You can install it by typing:"
3636
echo >&2 "composer install"
3737
exit 1
3838
fi
3939

40-
vendor/drush/drush/drush.launcher --config=${DIR}/drush/drushrc.php --alias-path=${DIR}/drush/site-aliases "$@"
40+
vendor/drush/drush/drush.launcher --config="${DIR}/drush/drushrc.php" --alias-path="${DIR}/drush/site-aliases" "$@"

0 commit comments

Comments
 (0)