From f56d3150364b4737a0dfe50a8dc9edfb809a497c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 31 Mar 2014 15:14:47 +0200 Subject: [PATCH] Ensure both bash and stty are present to assume cygwin, fixes #2857 --- src/Composer/IO/ConsoleIO.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php index 607b3a27e..c7703edfc 100644 --- a/src/Composer/IO/ConsoleIO.php +++ b/src/Composer/IO/ConsoleIO.php @@ -15,7 +15,7 @@ namespace Composer\IO; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Helper\HelperSet; -use Composer\Util\ProcessExecutor; +use Symfony\Component\Process\ExecutableFinder; /** * The Input/Output helper. @@ -170,12 +170,12 @@ class ConsoleIO extends BaseIO */ public function askAndHideAnswer($question) { - $process = new ProcessExecutor($this); - // handle windows if (defined('PHP_WINDOWS_VERSION_BUILD')) { + $finder = new ExecutableFinder(); + // use bash if it's present - if (0 === $process->execute("bash -c 'echo OK'", $output) && 'OK' === rtrim($output)) { + if ($finder->find('bash') && $finder->find('stty')) { $this->write($question, false); $value = rtrim(shell_exec('bash -c "stty -echo; read -r mypassword; stty echo; echo $mypassword"')); $this->write('');