flex: Symfony Flex breaks interactivity of Composer scripts
Hi,
I have a composer script defined:
{
"scripts": {
"post-install-cmd": [
"My\\Cool\\ScriptHandler::run"
],
"post-update-cmd": [
"My\\Cool\\ScriptHandler::run"
]
}
}
which works, except for one difference: the given InputStream is non-interactive.
<?php
use Composer\Script\Event;
class ScriptHandler
{
public function handle (Event $event)
{
var_dump($event->getIO()->isInteractive());
}
}
The problem is flex, as this short snipped shows:
$ composer run-script parameters
> My\Cool\ScriptHandler::handle
bool(false)
$ composer remove symfony/flex
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 1 removal
- Removing symfony/flex (v1.0.60)
[...]
$ composer run-script parameters
> My\Cool\ScriptHandler::handle
bool(true)
This currently makes implementing something similar to incenteev/composer-parameter-handler in combination with running flex impossible.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (17 by maintainers)
Commits related to this issue
- bug #377 Selectively enable "remove-vcs" instead of disabling interactivity (nicolas-grekas) This PR was merged into the 1.0-dev branch. Discussion ---------- Selectively enable "remove-vcs" instea... — committed to symfony/flex by fabpot 6 years ago
- Merge pull request #285 — committed to tgalopin/flex by deleted user 7 years ago
Quick reproducer on my side:
I can confirm
isInteractiveis false at this point.