Skip to content

Commit

Permalink
Force ainsi mode if not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Mar 1, 2020
1 parent 7157441 commit 0dc5757
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/LaravelDeployer/Commands/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,24 @@ public function __construct()

public function dep($command)
{
// Merge arguments and options.
$this->parameters = $this->getParameters();
$this->providedFile = $this->parameters->pull('--file');
$this->providedStrategy = $this->parameters->pull('--strategy');

// Force Ansi mode if not specified.
if ($this->parameters->intersect(['--ansi', '--no-ansi'])->isEmpty()) {
$this->parameters->push('--ansi');
}

// Fetch deploy config file.
if (! $deployFile = $this->getDeployFile()) {
$this->error("config/deploy.php file not found.");
$this->error("Please run `php artisan deploy:init` to get started.");
return;
}

// Delegate to DeployerPHP with the right parameters.
$parameters = $this->getParametersAsString($this->parameters);
$depBinary = 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'dep';
return $this->process("$depBinary --file=$deployFile $command $parameters");
Expand Down
4 changes: 2 additions & 2 deletions src/LaravelDeployer/Concerns/ParsesCliParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function getParameters()
public function parseArguments()
{
return collect($this->arguments())
->reject(function ($value) {
return ! $value && ! is_string($value) && ! is_numeric($value);
->filter(function ($value) {
return $value || is_string($value) || is_numeric($value);
})
->pipe(function ($arguments) {
$command = $arguments->get('command');
Expand Down

0 comments on commit 0dc5757

Please sign in to comment.