Skip to content

Commit

Permalink
Merge pull request #100 from tighten/adc/graceful-dirty
Browse files Browse the repository at this point in the history
Return 0 when no dirty files
  • Loading branch information
driftingly authored Mar 24, 2023
2 parents db96e65 + dc22c6d commit 3cf48c9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
16 changes: 14 additions & 2 deletions app/Commands/FixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use App\Support\ConfiguresForLintOrFix;
use App\Support\GetsCleaner;
use Exception;
use LaravelZero\Framework\Commands\Command;
use LaravelZero\Framework\Exceptions\ConsoleException;

class FixCommand extends Command
{
Expand All @@ -17,8 +19,18 @@ class FixCommand extends Command

public function handle(): int
{
$clean = $this->getCleaner('fix', $this->input->getOption('using'));
try {
$clean = $this->getCleaner('fix', $this->input->getOption('using'));

return $clean->execute();
return $clean->execute();
} catch (ConsoleException $exception) {
$this->error($exception->getMessage());

return $exception->getCode();
} catch (Exception $exception) {
$this->error($exception->getMessage());

return 1;
}
}
}
16 changes: 14 additions & 2 deletions app/Commands/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use App\Support\ConfiguresForLintOrFix;
use App\Support\GetsCleaner;
use Exception;
use LaravelZero\Framework\Commands\Command;
use LaravelZero\Framework\Exceptions\ConsoleException;

class LintCommand extends Command
{
Expand All @@ -17,8 +19,18 @@ class LintCommand extends Command

public function handle(): int
{
$clean = $this->getCleaner('lint', $this->input->getOption('using'));
try {
$clean = $this->getCleaner('lint', $this->input->getOption('using'));

return $clean->execute();
return $clean->execute();
} catch (ConsoleException $exception) {
$this->error($exception->getMessage());

return $exception->getCode();
} catch (Exception $exception) {
$this->error($exception->getMessage());

return 1;
}
}
}
Binary file modified builds/duster
Binary file not shown.
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
|
*/

'version' => '1.1.0',
'version' => '1.1.1',

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 3cf48c9

Please sign in to comment.