From 9901d66b62525a12980c1ed40daf48f440b11729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=B9=20th=E1=BB=A7y=20Coding?= Date: Mon, 14 Nov 2022 18:48:21 +0700 Subject: [PATCH] fix(command): run failed on windows --- src/LintCodeCommand.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/LintCodeCommand.php b/src/LintCodeCommand.php index 16b2ac6..d27727b 100644 --- a/src/LintCodeCommand.php +++ b/src/LintCodeCommand.php @@ -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 );