Skip to content

Commit 94aac0c

Browse files
committed
adding event and trying to read the arguments
1 parent d171f9e commit 94aac0c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/PatternLab/Console.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,16 +554,18 @@ public static function promptInput($prompt = "", $options = "", $default = "", $
554554
$prompt .= " <nophpeol>";
555555

556556
// make sure we're not running in no interaction mode. if so just use the default for the input
557-
if ((isset($_ENV['COMPOSER_NO_INTERACTION']) && $_ENV['COMPOSER_NO_INTERACTION'])) {
558-
$input = $default;
559-
} else {
557+
if (InstallerUtil::$isInteractive) {
560558

561559
// open the terminal and wait for feedback
562560
$stdin = fopen("php://stdin", "r");
563561
Console::writeTag($tag,$prompt);
564562
$input = trim(fgets($stdin));
565563
fclose($stdin);
566564

565+
} else {
566+
567+
$input = $default;
568+
567569
}
568570

569571
// check to see if it should be lowercased before sending back

src/PatternLab/InstallerUtil.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
class InstallerUtil {
2424

25+
public static $isInteractive;
26+
2527
/**
2628
* Move the component files from the package to their location in the patternlab-components dir
2729
* @param {String/Array} the items to create a fileList for
@@ -583,8 +585,8 @@ protected static function removeDots($path) {
583585
*/
584586
protected static function packagesInstall($installerInfo, $event) {
585587

586-
print "arguments:";
587-
print_r($event->getArguments());
588+
// mark if this is an interactive call or not
589+
self::$isInteractive = $event->getIO()->isInteractive();
588590

589591
// initialize a bunch of stuff like config and console
590592
self::init();

0 commit comments

Comments
 (0)