Skip to content

Instantly share code, notes, and snippets.

@ZenLiuCN
Created January 6, 2025 02:24
Show Gist options
  • Save ZenLiuCN/956e2281473fe5c2c4bf60fd34f5d44a to your computer and use it in GitHub Desktop.
Save ZenLiuCN/956e2281473fe5c2c4bf60fd34f5d44a to your computer and use it in GitHub Desktop.
scripts for purge maven build caches (target folder)
@echo off
for /f "tokens=*" %%G in ('dir /b /s /a:d "classes*"') do del /Q /S %%G
for /f "tokens=*" %%G in ('dir /b /s /a:d "test-classes*"') do del /Q /S %%G
rem for clean full target folders
:: for /f "tokens=*" %%G in ('dir /b /s /a:d "test-classes*"') do del /Q /S %%G
#!/bin/sh
find "./" -type d -name "classes" -path "./**/target/**" | while read -r file; do
echo purify $file
rm -rf $file
done
find "./" -type d -name "test-classes" -path "./**/target/**" | while read -r file; do
echo purify $file
rm -rf $file
done
## for clean full target folders
# find "./" -type d -name "target" -path "./**/**" | while read -r file; do
# echo purify $file
# rm -rf $file
# done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment