Skip to content

Commit

Permalink
Restore Prompt output after calling another command (#47929)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Aug 2, 2023
1 parent 62d570e commit 4e6a5ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Console/Concerns/CallsCommands.php
Expand Up @@ -64,9 +64,13 @@ protected function runCommand($command, array $arguments, OutputInterface $outpu
{
$arguments['command'] = $command;

return $this->resolveCommand($command)->run(
$result = $this->resolveCommand($command)->run(
$this->createInputFromArguments($arguments), $output
);

$this->restorePrompts();

return $result;
}

/**
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Console/Concerns/ConfiguresPrompts.php
Expand Up @@ -119,4 +119,14 @@ protected function promptUntilValid($prompt, $required, $validate)
return $result;
}
}

/**
* Restore the prompts output.
*
* @return void
*/
protected function restorePrompts()
{
Prompt::setOutput($this->output);
}
}

0 comments on commit 4e6a5ad

Please sign in to comment.