@echo off setlocal EnableExtensions EnableDelayedExpansion set "ROOT=%~1" if "%ROOT%"=="" set "ROOT=." if not exist "%ROOT%\" ( echo Folder not found: %ROOT% exit /b 1 ) pushd "%ROOT%" || exit /b 1 set "README=" for %%f in (README.md README.rst README.txt README) do ( if not defined README if exist "%%f" set "README=%%f" ) if not defined README ( echo No README file found. popd exit /b 1 ) for %%f in ("%README%") do if %%~zf==0 ( echo README is empty: %README% popd exit /b 1 ) echo Found: %README% set "MISSING=" findstr /r /c:"^# " "%README%" >nul if errorlevel 1 ( echo Warning: no top-level Markdown heading. ) findstr /i /c:"install" "%README%" >nul if errorlevel 1 ( echo Missing section or word: install set "MISSING=1" ) findstr /i /c:"usage" "%README%" >nul if errorlevel 1 ( echo Missing section or word: usage set "MISSING=1" ) findstr /i /c:"license" "%README%" >nul if errorlevel 1 ( echo Missing section or word: license set "MISSING=1" ) findstr /i /c:"contribut" "%README%" >nul if errorlevel 1 ( echo Missing section or word: contributing set "MISSING=1" ) if defined MISSING ( echo README needs review. popd exit /b 1 ) echo README basic checks passed. popd exit /b 0