Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc4ca9b

Browse files
authored
Add ssh.pipefail config and use it in sql:dump --gzip (#3818)
1 parent 3de56d4 commit bc4ca9b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/example.drush.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ ssh:
151151
# password authentication, and is included here, so you may add additional
152152
# parameters without losing the default configuration.
153153
options: '-o PasswordAuthentication=no'
154+
# This string is valid for Bash shell. Override in case you need something different. See https://github.com/drush-ops/drush/issues/3816.
155+
pipefail: 'set -o pipefail; '
154156

155157
notify:
156158
# Notify when command takes more than 30 seconds.

src/Sql/SqlBase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ public function dump()
162162
$cmd = $this->dumpCmd($table_selection);
163163
// Gzip the output from dump command(s) if requested.
164164
if ($this->getOption('gzip')) {
165-
$cmd .= ' | gzip -f';
165+
// See https://github.com/drush-ops/drush/issues/3816.
166+
$pipefail = $this->getConfig()->get('ssh.pipefail', 'set -o pipefail;');
167+
$cmd = "$pipefail $cmd | gzip -f";
166168
$file_suffix .= '.gz';
167169
}
168170
if ($file) {

0 commit comments

Comments
 (0)