使用bat 刪除失效的 Maven 倉庫 jar

@echo off
echo @describe 找出所有 lastUpdated文件,並刪除它。
echo @author XinLau
echo @date 2020年6月4日
:again
set /p REPOSITORY_PATH=輸入你的Maven倉庫路徑:
:: Remove all double quotes
rem 正在搜索所有 lastUpdated文件...
set REPOSITORY_PATH=%REPOSITORY_PATH:"=%
if not exist "%REPOSITORY_PATH%" (
   echo Maven warehouse address not found, please try again.
   goto again
)
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
	del /s /q "%%i"
)
echo 過期文件刪除成功.
pause;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章