diff --git a/src/Cli/Executable/Abstraction.php b/src/Cli/Executable/Abstraction.php index ad5480fb..59b0713f 100644 --- a/src/Cli/Executable/Abstraction.php +++ b/src/Cli/Executable/Abstraction.php @@ -64,10 +64,7 @@ protected function setup(string $cmd, string $path = '') */ public function getCommandLine() : CommandLine { - $process = $this->createCommandLine(); - $process->pipeFail(true); - - return $process; + return $this->createCommandLine(); } /** diff --git a/src/Cli/Executable/Mysqldump.php b/src/Cli/Executable/Mysqldump.php index edcb040b..4ed11d43 100644 --- a/src/Cli/Executable/Mysqldump.php +++ b/src/Cli/Executable/Mysqldump.php @@ -423,6 +423,7 @@ public function dumpTo(string $path) : Mysqldump * Mysqldump CommandLine generator. * * @return \SebastianFeldmann\Cli\CommandLine + * @throws \phpbu\App\Exception */ protected function createCommandLine() : CommandLine { diff --git a/tests/phpbu/Backup/Source/MysqldumpTest.php b/tests/phpbu/Backup/Source/MysqldumpTest.php index a21f1881..04d3765c 100644 --- a/tests/phpbu/Backup/Source/MysqldumpTest.php +++ b/tests/phpbu/Backup/Source/MysqldumpTest.php @@ -65,8 +65,7 @@ public function testPipeCompression() $executable = $mysqldump->getExecutable($target); $this->assertEquals( - 'set -o pipefail; ' - . PHPBU_TEST_BIN . '/mysqldump --all-databases | ' + PHPBU_TEST_BIN . '/mysqldump --all-databases | ' . PHPBU_TEST_BIN . '/gzip > /tmp/foo.sql.gz', $executable->getCommand() ); diff --git a/tests/phpbu/Backup/Source/TarTest.php b/tests/phpbu/Backup/Source/TarTest.php index b727d145..d2064db1 100644 --- a/tests/phpbu/Backup/Source/TarTest.php +++ b/tests/phpbu/Backup/Source/TarTest.php @@ -182,8 +182,7 @@ public function testThrottle() $exec = $tar->getExecutable($target); $this->assertEquals( - 'set -o pipefail; ' - . PHPBU_TEST_BIN . '/tar -c -C \'' + PHPBU_TEST_BIN . '/tar -c -C \'' . dirname(__DIR__) . '\' \'' . basename(__DIR__) . '\'' . ' | pv -qL \'1m\' > /tmp/backup.tar', diff --git a/tests/phpbu/Cli/Executable/MysqldumpTest.php b/tests/phpbu/Cli/Executable/MysqldumpTest.php index 28fc1933..b81975af 100644 --- a/tests/phpbu/Cli/Executable/MysqldumpTest.php +++ b/tests/phpbu/Cli/Executable/MysqldumpTest.php @@ -252,7 +252,7 @@ public function testCompressor() $mysqldump->compressOutput($compression)->dumpTo('/tmp/foo.mysql'); $this->assertEquals( - 'set -o pipefail; ' . $path . '/mysqldump --all-databases | ' . $path . '/gzip > /tmp/foo.mysql.gz', + $path . '/mysqldump --all-databases | ' . $path . '/gzip > /tmp/foo.mysql.gz', $mysqldump->getCommand() ); } diff --git a/tests/phpbu/Cli/Executable/TarTest.php b/tests/phpbu/Cli/Executable/TarTest.php index d7113439..d0cf9bf1 100644 --- a/tests/phpbu/Cli/Executable/TarTest.php +++ b/tests/phpbu/Cli/Executable/TarTest.php @@ -169,8 +169,7 @@ public function testThrottle() ->throttle('1m'); $this->assertEquals( - 'set -o pipefail; ' - . PHPBU_TEST_BIN . '/tar -jc -C \'' . $tarC . '\' \'' . $tarD . '\'' + PHPBU_TEST_BIN . '/tar -jc -C \'' . $tarC . '\' \'' . $tarD . '\'' . ' | pv -qL \'1m\' > /tmp/foo.tar.bzip2', $tar->getCommand() ); @@ -192,8 +191,7 @@ public function testThrottleAndRemoveSourceDir() ->throttle('1m'); $this->assertEquals( - 'set -o pipefail; ' - . '(' . PHPBU_TEST_BIN . '/tar -jc -C \'' . $tarC . '\' \'' . $tarD . '\'' + '(' . PHPBU_TEST_BIN . '/tar -jc -C \'' . $tarC . '\' \'' . $tarD . '\'' . ' && rm -rf \'' . $dir . '\')' . ' | pv -qL \'1m\' > /tmp/foo.tar.bzip2', $tar->getCommand()