Skip to content

Commit 4c48721

Browse files
committed
Making sure one command only gets executed after a sucessful execution
1 parent e6f5267 commit 4c48721

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Command/SiteBaseCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function settingsPhpDirectory() {
261261
$settingsPath = $webSitesPath . 'default';
262262

263263
$command = sprintf(
264-
'cd %s; find . -name settings.php',
264+
'cd %s && find . -name settings.php',
265265
$this->shellPath($webSitesPath)
266266
);
267267

src/Command/SiteCheckoutCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function _validateBranch(InputInterface $input) {
191191
*/
192192
protected function gitDiff($directory) {
193193
$command = sprintf(
194-
'cd %s; git diff-files --name-status -r --ignore-submodules',
194+
'cd %s && git diff-files --name-status -r --ignore-submodules',
195195
$this->shellPath($directory)
196196
);
197197

@@ -256,7 +256,7 @@ protected function gitClone($branch, $repo, $destination) {
256256
* @throws SiteCommandException
257257
*/
258258
protected function gitCheckout($branch, $destination) {
259-
$command = sprintf('cd %s; git fetch --all; git checkout %s',
259+
$command = sprintf('cd %s && git fetch --all && git checkout %s',
260260
$this->shellPath($destination),
261261
$branch
262262
);

src/Command/SiteComposeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
6767
*/
6868
protected function runCommand($command, $destination) {
6969
$command = sprintf(
70-
'cd %s; composer %s;',
70+
'cd %s && composer %s',
7171
$this->shellPath($destination),
7272
$command
7373
);

src/Command/SiteDbImportCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ protected function execute(InputInterface $input, OutputInterface $output) {
126126
if (!$this->fileExists($this->filename)) {
127127
//@todo Use drupal site:install instead of Drush.
128128
$command = sprintf(
129-
'cd %s; ' .
130-
'chmod 777 ../default; ' .
131-
'chmod 777 settings.php; ' .
132-
'drush si -y %s %s;' .
133-
'drush cim;',
129+
'cd %s && ' .
130+
'chmod 777 ../default && ' .
131+
'chmod 777 settings.php && ' .
132+
'drush si -y %s %s && ' .
133+
'drush cim',
134134
$this->shellPath($this->destination),
135135
$this->profile,
136136
$options

0 commit comments

Comments
 (0)