-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @ECHO off | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cls | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECHO Deleting all BIN and OBJ folders... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECHO. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FOR /d /r . %%d in (bin,obj) DO ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IF EXIST "%%d" ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECHO %%d | FIND /I "\node_modules\" > Nul && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECHO.Skipping: %%d | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) || ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECHO.Deleting: %%d | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rd /s/q "%%d" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+17
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 |
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.