Skip to content

Commit

Permalink
fix(command): run failed on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
phuthuycoding authored Nov 14, 2022
1 parent 266c1ab commit 9901d66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/LintCodeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ class LintCodeCommand extends Command
public function handle()
{
$bin = $this->option('fix') ? 'phpcbf' : 'phpcs';
$files = empty($this->argument('files')) ? [ '.' ] : $this->argument('files');

$files = empty($this->argument('files')) ? ['.'] : $this->argument('files');
$command = "vendor" . DIRECTORY_SEPARATOR . "bin" . DIRECTORY_SEPARATOR . "$bin --standard=";
exec(
"vendor/bin/$bin --standard=" . $this->option('standard')
. ' ' . implode(' ', $files),
$command . $this->option('standard') . ' ' . implode(' ', $files),
$output,
$code
);
Expand Down

0 comments on commit 9901d66

Please sign in to comment.