Skip to content

Commit 0dc5757

Browse files
committed
Force ainsi mode if not specified
1 parent 7157441 commit 0dc5757

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/LaravelDeployer/Commands/BaseCommand.php

+8
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,24 @@ public function __construct()
4343

4444
public function dep($command)
4545
{
46+
// Merge arguments and options.
4647
$this->parameters = $this->getParameters();
4748
$this->providedFile = $this->parameters->pull('--file');
4849
$this->providedStrategy = $this->parameters->pull('--strategy');
4950

51+
// Force Ansi mode if not specified.
52+
if ($this->parameters->intersect(['--ansi', '--no-ansi'])->isEmpty()) {
53+
$this->parameters->push('--ansi');
54+
}
55+
56+
// Fetch deploy config file.
5057
if (! $deployFile = $this->getDeployFile()) {
5158
$this->error("config/deploy.php file not found.");
5259
$this->error("Please run `php artisan deploy:init` to get started.");
5360
return;
5461
}
5562

63+
// Delegate to DeployerPHP with the right parameters.
5664
$parameters = $this->getParametersAsString($this->parameters);
5765
$depBinary = 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'dep';
5866
return $this->process("$depBinary --file=$deployFile $command $parameters");

src/LaravelDeployer/Concerns/ParsesCliParameters.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function getParameters()
2222
public function parseArguments()
2323
{
2424
return collect($this->arguments())
25-
->reject(function ($value) {
26-
return ! $value && ! is_string($value) && ! is_numeric($value);
25+
->filter(function ($value) {
26+
return $value || is_string($value) || is_numeric($value);
2727
})
2828
->pipe(function ($arguments) {
2929
$command = $arguments->get('command');

0 commit comments

Comments
 (0)