Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RunScriptCommand.php

function RunScriptCommand::interact

Overrides Command::interact

File

vendor/composer/composer/src/Composer/Command/RunScriptCommand.php, line 75

Class

RunScriptCommand
@author Fabien Potencier <fabien.potencier@gmail.com>

Namespace

Composer\Command

Code

protected function interact(InputInterface $input, OutputInterface $output) : void {
    $scripts = $this->getScripts();
    if (count($scripts) === 0) {
        return;
    }
    if ($input->getArgument('script') !== null || $input->getOption('list')) {
        return;
    }
    $options = [];
    foreach ($scripts as $script) {
        $options[$script['name']] = $script['description'];
    }
    $io = $this->getIO();
    $script = $io->select('Script to run: ', $options, '', 1, 'Invalid script name "%s"');
    $input->setArgument('script', $script);
}
RSS feed
Powered by Drupal