From 3210da0b8445293b6d10a92c076c88d084969c25 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 1 Apr 2012 20:47:31 +0200 Subject: [PATCH] Cleanups --- src/Composer/IO/ConsoleIO.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php index 7e94d9731..119c23654 100644 --- a/src/Composer/IO/ConsoleIO.php +++ b/src/Composer/IO/ConsoleIO.php @@ -135,9 +135,8 @@ class ConsoleIO implements IOInterface return $value; } - // for other OS with shell_exec (hide the answer) - $command = "/usr/bin/env bash -c 'echo OK'"; - if (rtrim(shell_exec($command)) === 'OK') { + // handle other OSs with bash if available to hide the answer + if ('OK' === rtrim(shell_exec("/usr/bin/env bash -c 'echo OK'"))) { $this->write($question, false); $command = "/usr/bin/env bash -c 'read -s mypassword && echo \$mypassword'"; $value = rtrim(shell_exec($command)); @@ -146,9 +145,7 @@ class ConsoleIO implements IOInterface return $value; } - // for other OS without shell_exec (does not hide the answer) - $this->write(''); - + // not able to hide the answer, proceed with normal question handling return $this->ask($question); }