Skip to content

Commit 6b03e28

Browse files
amiuhlejasonvarga
andauthored
Don't enable tty if no-interaction option is true (#66)
Co-authored-by: Jason Varga <jason@pixelfear.com>
1 parent 2abc0f8 commit 6b03e28

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Concerns/RunsCommands.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ protected function runCommands(array $commands, ?string $workingPath = null, boo
5555

5656
if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) {
5757
try {
58-
$process->setTty(true);
58+
if ($this->input->hasOption('no-interaction') && $this->input->getOption('no-interaction')) {
59+
$process->setTty(false);
60+
} else {
61+
$process->setTty(true);
62+
}
5963
} catch (RuntimeException $e) {
6064
$this->output->writeln(' <bg=yellow;fg=black> WARN </> '.$e->getMessage().PHP_EOL);
6165
}

0 commit comments

Comments
 (0)