Files
ks-app-employment-service/clean-build-cache.bat
2025-10-21 22:58:47 +08:00

88 lines
2.1 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
REM 清理 uni-app 项目编译缓存脚本
echo ================================================
echo uni-app 项目缓存清理工具
echo ================================================
echo.
echo [提示] 此脚本将清理以下内容:
echo 1. unpackage 编译输出目录
echo 2. node_modules 依赖目录(如果需要)
echo 3. HBuilderX 临时文件
echo.
set /p confirm="确认清理缓存吗?(Y/N): "
if /i not "%confirm%"=="Y" (
echo 已取消操作
pause
exit
)
echo.
echo ================================================
echo 开始清理...
echo ================================================
echo.
REM 1. 清理 unpackage 目录
if exist "unpackage" (
echo [1/3] 正在删除 unpackage 目录...
rd /s /q "unpackage"
echo 已删除 unpackage 目录
) else (
echo [1/3] unpackage 目录不存在,跳过
)
echo.
REM 2. 询问是否清理 node_modules
if exist "node_modules" (
set /p cleanNodeModules="[2/3] 检测到 node_modules 目录,是否删除?(Y/N): "
if /i "!cleanNodeModules!"=="Y" (
echo 正在删除 node_modules 目录...
rd /s /q "node_modules"
echo 已删除 node_modules 目录
echo 提示:如需重新安装,请运行 npm install
) else (
echo 跳过 node_modules 目录
)
) else (
echo [2/3] node_modules 目录不存在,跳过
)
echo.
REM 3. 清理 HBuilderX 临时文件
echo [3/3] 清理 HBuilderX 临时文件...
REM 删除可能的临时文件和缓存
if exist ".hbuilderx" (
rd /s /q ".hbuilderx"
echo 已删除 .hbuilderx 目录
)
if exist ".temp" (
rd /s /q ".temp"
echo 已删除 .temp 目录
)
if exist ".cache" (
rd /s /q ".cache"
echo 已删除 .cache 目录
)
echo 完成
echo.
echo ================================================
echo 清理完成!
echo ================================================
echo.
echo 建议操作:
echo 1. 重启 HBuilderX
echo 2. 重新编译项目
echo 3. 如果清理了 node_modules请先运行 npm install
echo.
echo 按任意键退出...
pause >nul