-
-
Notifications
You must be signed in to change notification settings - Fork 362
chore(Tools): add delete-bin tools #6765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideAdds a Windows batch script tool that recursively finds and deletes all bin and obj directories (excluding those under node_modules), providing console feedback and a pause at the end. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a Windows batch script tool for cleaning up .NET build artifacts by deleting bin and obj folders from the project directory tree. The script addresses issue #6764 by providing developers with an automated way to clean build outputs.
- Adds a new Windows batch file for deleting bin and obj directories recursively
- Implements logic to skip node_modules directories to avoid deleting Node.js dependencies
- Provides user feedback during the deletion process
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| IF EXIST "%%d" ( | ||
| ECHO %%d | FIND /I "\node_modules\" > Nul && ( | ||
| ECHO.Skipping: %%d | ||
| ) || ( | ||
| ECHO.Deleting: %%d | ||
| rd /s/q "%%d" | ||
| ) | ||
| ) | ||
| ) | ||
|
|
Copilot
AI
Sep 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The node_modules exclusion logic is flawed. The FIND command will match any path containing '\node_modules' anywhere in the string, which could incorrectly skip legitimate bin/obj folders that happen to contain this substring in their path. Consider using a more precise pattern match or checking if the parent directory is specifically named 'node_modules'.
| IF EXIST "%%d" ( | |
| ECHO %%d | FIND /I "\node_modules\" > Nul && ( | |
| ECHO.Skipping: %%d | |
| ) || ( | |
| ECHO.Deleting: %%d | |
| rd /s/q "%%d" | |
| ) | |
| ) | |
| ) | |
| IF EXIST "%%d" ( | |
| REM Extract parent directory name | |
| FOR %%p IN ("%%~dpd.") DO ( | |
| SET "PARENT=%%~nxp" | |
| CALL :CheckNodeModules "%%d" "%%PARENT%" | |
| ) | |
| ) | |
| ) | |
| GOTO :EOF | |
| :CheckNodeModules | |
| SETLOCAL ENABLEDELAYEDEXPANSION | |
| SET "DIR=%~1" | |
| SET "PARENT=%~2" | |
| IF /I "!PARENT!"=="node_modules" ( | |
| ECHO.Skipping: !DIR! | |
| ) ELSE ( | |
| ECHO.Deleting: !DIR! | |
| rd /s/q "!DIR!" | |
| ) | |
| ENDLOCAL | |
| EXIT /B |
| rd /s/q "%%d" | ||
| ) |
Copilot
AI
Sep 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /q flag suppresses confirmation prompts, making this command potentially destructive without user awareness. Consider adding a confirmation prompt or verbose logging before deletion to prevent accidental data loss.
| rd /s/q "%%d" | |
| ) | |
| CHOICE /C YN /N /M "Are you sure you want to delete this folder? (Y/N): " | |
| IF ERRORLEVEL 2 ( | |
| ECHO Skipped: %%d | |
| ) ELSE ( | |
| rd /s/q "%%d" | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link issues
fixes #6764
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enhancements: