From aa9a2110bba7db8732e236bf2a6a5272fd4dbc80 Mon Sep 17 00:00:00 2001 From: PabloKowalczyk <11366345+PabloKowalczyk@users.noreply.github.com> Date: Thu, 18 Jun 2020 07:58:44 +0200 Subject: [PATCH 1/3] Change app version for v2.3 line --- crunz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crunz b/crunz index 16f4422e..f9b2bf94 100755 --- a/crunz +++ b/crunz @@ -67,5 +67,5 @@ if ($autoloadFileFound === false) { ); } -$application = new Crunz\Application('Crunz Command Line Interface', 'v2.2.0'); +$application = new Crunz\Application('Crunz Command Line Interface', 'v2.3.x-dev'); $application->run(); From 07c97c7528500387e88c54480aa149e83bd1ffa1 Mon Sep 17 00:00:00 2001 From: John Carew Date: Sat, 25 Jul 2020 17:58:08 -0500 Subject: [PATCH 2/3] Add quotes around path in case of spaces. For Windows, add quotes around path in case of spaces. --- src/Event.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Event.php b/src/Event.php index b0f40ad3..c6809f58 100644 --- a/src/Event.php +++ b/src/Event.php @@ -1110,8 +1110,12 @@ protected function serializeClosure(Closure $closure) $closure = (new OpisClosureSerializer())->serialize($closure); $serializedClosure = \http_build_query([$closure]); $crunzRoot = CRUNZ_BIN; - - return PHP_BINARY . " {$crunzRoot} closure:run {$serializedClosure}"; + $phpBin = PHP_BINARY; + if (DIRECTORY_SEPARATOR === '\\') { + // For Windows, add quotes around path in case of spaces. + $phpBin = '"'.$phpBin.'"'; + } + return "{$phpBin} {$crunzRoot} closure:run {$serializedClosure}"; } /** From 879210e659bd1a1808f80e681be76b80eafdf28a Mon Sep 17 00:00:00 2001 From: John Carew Date: Sat, 25 Jul 2020 19:35:40 -0500 Subject: [PATCH 3/3] Update to include quoted path for windows unit test Update to include quoted path for windows unit test --- tests/Unit/EventTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Unit/EventTest.php b/tests/Unit/EventTest.php index 000abfc5..71be4f14 100644 --- a/tests/Unit/EventTest.php +++ b/tests/Unit/EventTest.php @@ -346,7 +346,12 @@ public function closureCommandHaveFullBinaryPaths(): void if (!\defined('CRUNZ_BIN')) { \define('CRUNZ_BIN', __FILE__); } - + + $phpBin = PHP_BINARY; + if ($this->isWindows()) { + $phpBin = '"'.$phpBin.'"'; + } + $closure = function () { return 0; }; @@ -359,7 +364,7 @@ public function closureCommandHaveFullBinaryPaths(): void $command = $event->buildCommand(); - $this->assertSame(PHP_BINARY . " {$crunzBin} closure:run {$queryClosure}", $command); + $this->assertSame("{$phpBin} {$crunzBin} closure:run {$queryClosure}", $command); } /** @test */