Skip to content

Commit

Permalink
Merge branch '2.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jan 26, 2024
2 parents f402517 + 7048ff3 commit d3aeb13
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Composer/Command/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ protected function initialize(InputInterface $input, OutputInterface $output)
// initialize a plugin-enabled Composer instance, either local or global
$disablePlugins = $input->hasParameterOption('--no-plugins');
$disableScripts = $input->hasParameterOption('--no-scripts');

$application = parent::getApplication();
if ($application instanceof Application && $application->getDisablePluginsByDefault()) {
$disablePlugins = true;
}
if ($application instanceof Application && $application->getDisableScriptsByDefault()) {
$disableScripts = true;
}

if ($this instanceof SelfUpdateCommand) {
$disablePlugins = true;
$disableScripts = true;
Expand Down
10 changes: 10 additions & 0 deletions src/Composer/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,16 @@ public function getInitialWorkingDirectory()
return $this->initialWorkingDirectory;
}

public function getDisablePluginsByDefault(): bool
{
return $this->disablePluginsByDefault;
}

public function getDisableScriptsByDefault(): bool
{
return $this->disableScriptsByDefault;
}

/**
* @return 'prompt'|bool
*/
Expand Down

0 comments on commit d3aeb13

Please sign in to comment.