Files

40 lines
1.1 KiB
Batchfile

@echo off
:: Batch wrapper to run the PowerShell script
:: This script purges nested .git directories and redundant gitignore/gitattributes files
echo ========================================
echo Purge Nested Git Configurationsecho ========================================
echo.
:: Check if running from the correct directory
if not exist ".git" (
echo ERROR: No .git directory found in current folder.
echo Please run this script from your repository root.
pause
exit /b 1
)
echo This will remove all nested .git directories and .gitignore/.gitattributes
echo files from subdirectories, keeping only the root-level ones.
echo.
:: Show dry run first
echo Running DRY RUN first to preview changes...
echo.
powershell -ExecutionPolicy Bypass -File "%~dp0purge-nested-git.ps1" -DryRun
echo.
set /p confirm="Do you want to proceed with deletion? (y/n): "
if /i "%confirm%"=="y" (
echo.
echo Proceeding with deletion...
powershell -ExecutionPolicy Bypass -File "%~dp0purge-nested-git.ps1"
) else (
echo.
echo Cancelled. No changes were made.
)
echo.
pause