From 40b330393a72cc7811b168b121786814db47e47c Mon Sep 17 00:00:00 2001 From: "s.poniecki" Date: Wed, 11 Oct 2017 14:24:32 +0200 Subject: [PATCH 1/2] windows support --- .gitattributes | 1 + bin/php-code-validator.bat | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .gitattributes create mode 100644 bin/php-code-validator.bat diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..24d11df --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.php text eol=lf diff --git a/bin/php-code-validator.bat b/bin/php-code-validator.bat new file mode 100644 index 0000000..4ce615b --- /dev/null +++ b/bin/php-code-validator.bat @@ -0,0 +1,16 @@ +@echo off +setlocal DISABLEDELAYEDEXPANSION + +SET BIN_DIR=%~dp0 + +if exist "%BIN_DIR%\phpcs.bat" ( + REM used within project + SET SCRIPT_DIR=%BIN_DIR%\..\flyeralarm\php-code-validator + SET COMPOSER_BIN=%BIN_DIR% +) else ( + REM standalone + SET SCRIPT_DIR=%BIN_DIR%\.. + SET COMPOSER_BIN=%BIN_DIR%\..\vendor\bin +) + +%COMPOSER_BIN%/phpcs.bat -w -p -s --standard=%SCRIPT_DIR%\ruleset.xml %* From 09dd2cae3a6f748e5852654479919fc552aaf5a1 Mon Sep 17 00:00:00 2001 From: "s.poniecki" Date: Wed, 11 Oct 2017 14:51:08 +0200 Subject: [PATCH 2/2] windows support --- bin/php-code-validator.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/php-code-validator.bat b/bin/php-code-validator.bat index 4ce615b..a9b4b3c 100644 --- a/bin/php-code-validator.bat +++ b/bin/php-code-validator.bat @@ -5,12 +5,12 @@ SET BIN_DIR=%~dp0 if exist "%BIN_DIR%\phpcs.bat" ( REM used within project - SET SCRIPT_DIR=%BIN_DIR%\..\flyeralarm\php-code-validator - SET COMPOSER_BIN=%BIN_DIR% + SET "SCRIPT_DIR=%BIN_DIR%\..\flyeralarm\php-code-validator" + SET "COMPOSER_BIN=%BIN_DIR%" ) else ( REM standalone - SET SCRIPT_DIR=%BIN_DIR%\.. - SET COMPOSER_BIN=%BIN_DIR%\..\vendor\bin + SET "SCRIPT_DIR=%BIN_DIR%\.." + SET "COMPOSER_BIN=%BIN_DIR%\..\vendor\bin" ) %COMPOSER_BIN%/phpcs.bat -w -p -s --standard=%SCRIPT_DIR%\ruleset.xml %*