2019-12-20 17:26:26 +00:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
|
2019-12-27 13:56:03 +00:00
|
|
|
cd /D "%~dp0.."
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo ERROR! >&2
|
|
|
|
exit /B 1
|
|
|
|
)
|
2019-12-20 17:26:26 +00:00
|
|
|
|
|
|
|
set SRC_DIR=%CD%
|
2019-12-27 13:56:03 +00:00
|
|
|
set rc=0
|
2019-12-20 17:26:26 +00:00
|
|
|
|
2019-12-27 13:56:03 +00:00
|
|
|
echo # Linting shell scripts
|
|
|
|
docker --version >NUL 2>NUL
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo Docker is not installed, or it's not running >&2
|
|
|
|
set rc=1
|
|
|
|
) else (
|
2023-10-10 08:37:52 +00:00
|
|
|
docker run --rm -v "%SRC_DIR%:/src" -w /src --entrypoint /src/scripts/invoke-shfmt mvdan/shfmt:v3.7.0-alpine fix
|
2019-12-27 13:56:03 +00:00
|
|
|
if errorlevel 1 (
|
|
|
|
echo ERROR! >&2
|
|
|
|
set rc=1
|
|
|
|
)
|
|
|
|
)
|
2019-12-20 17:26:26 +00:00
|
|
|
|
2019-12-27 13:56:03 +00:00
|
|
|
echo # Linting PHP files
|
|
|
|
call composer --version >NUL 2>NUL
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo Composer is not installed. >&2
|
|
|
|
set rc=1
|
|
|
|
) else (
|
|
|
|
if not exist .\vendor\autoload.php (
|
|
|
|
echo Composer dependencies are not installed. >&2
|
|
|
|
set rc=1
|
|
|
|
) else (
|
|
|
|
call composer run-script lint
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo ERROR! >&2
|
|
|
|
set rc=1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2019-12-20 17:26:26 +00:00
|
|
|
|
2019-12-27 13:56:03 +00:00
|
|
|
exit /B %rc%
|