Skip to content

Commit

Permalink
fix(composer-updater): remove --ansi option from commands
Browse files Browse the repository at this point in the history
- Removed the '--ansi' option from the 'update', 'normalize', and 'outdated' commands.
- Adjusted the command execution to improve compatibility and avoid potential issues with output formatting.
- Added '--no-interaction', '--no-scripts' options for better command handling.
  • Loading branch information
[email protected] committed Oct 13, 2024
1 parent 88b674e commit 38a5c27
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 85 deletions.
17 changes: 12 additions & 5 deletions composer-updater
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ $status = (new SingleCommandApplication())

private function updateComposerPackages(): self
{
$this->mustRunCommand("$this->composerBinary update -W --ansi");
$this->mustRunCommand("$this->composerBinary update -W");

return $this;
}
Expand Down Expand Up @@ -147,7 +147,7 @@ $status = (new SingleCommandApplication())

private function normalizeComposerJson(): self
{
$this->mustRunCommand("$this->composerBinary normalize --diff --ansi");
$this->mustRunCommand("$this->composerBinary normalize --diff");

return $this;
}
Expand Down Expand Up @@ -202,7 +202,7 @@ $status = (new SingleCommandApplication())
return array_reduce(
json_decode(
$this
->mustRunCommand("$this->highestComposerBinary outdated --format=json --direct --ansi")
->mustRunCommand("$this->highestComposerBinary outdated --format=json --direct")
->getOutput(),
true
)['installed'],
Expand Down Expand Up @@ -252,9 +252,16 @@ $status = (new SingleCommandApplication())
$input = null,
?float $timeout = 300
): Process {
$additionalOptions = [
'--no-interaction',
// '--no-plugins',
'--no-scripts',
'--ansi',
];

$process = is_string($command)
? Process::fromShellCommandline($command, $cwd, $env, $input, $timeout)
: new Process($command, $cwd, $env, $input, $timeout);
? Process::fromShellCommandline(sprintf("$command %s", implode(' ', $additionalOptions)), $cwd, $env, $input, $timeout)
: new Process($command + $additionalOptions, $cwd, $env, $input, $timeout);

$this->symfonyStyle->warning($process->getCommandLine());

Expand Down
Loading

0 comments on commit 38a5c27

Please sign in to comment.