diff --git a/Dockerfile b/Dockerfile index a21922c..f8e9676 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM php:7 RUN curl -LO https://github.com/marcelsud/diffcs/releases/download/v0.2.0/diffcs.phar && chmod +x diffcs.phar && mv diffcs.phar /usr/local/bin/diffcs +RUN curl -LO https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar && chmod +x phpcs.phar && mv phpcs.phar /usr/local/bin/phpcs ENTRYPOINT ["diffcs"] CMD ["--help"] diff --git a/README.md b/README.md index fb7cc36..c2bd05c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ You can grab a copy of marcelsud/diffcs in either of the following ways: You can simply download a pre-compiled and ready-to-use version as a Phar to any directory. Simply download the latest diffcs.phar file from our [releases page](https://github.com/marcelsud/diffcs/releases): ``` -curl -LO https://github.com/marcelsud/diffcs/releases/download/v0.2.0/diffcs.phar +curl -LO https://github.com/marcelsud/diffcs/releases/download/v0.2.1/diffcs.phar php diffcs.phar --help ``` diff --git a/src/Melody/Diffcs/Executor.php b/src/Melody/Diffcs/Executor.php index 2bea548..a81cb3f 100644 --- a/src/Melody/Diffcs/Executor.php +++ b/src/Melody/Diffcs/Executor.php @@ -178,7 +178,7 @@ public function runCodeSniffer($downloadedFiles) } $command = sprintf( - "php $phpcsBinPath %s/%s --standard=%s", + "$phpcsBinPath %s/%s --standard=%s", sys_get_temp_dir(), $file, $this->codeStandard @@ -201,7 +201,7 @@ public function runCodeSniffer($downloadedFiles) private static function getPhpCsBinPath() { - $phpcsBinPath = shell_exec('which phpcs'); + $phpcsBinPath = trim(shell_exec('which phpcs')); if (!$phpcsBinPath) { $phpcsBinPath = sys_get_temp_dir() . '/.diffcs/phpcs';