Files
Electron_x64_x32/clean-build.bat
2025-12-02 17:41:15 +08:00

43 lines
1.1 KiB
Batchfile

@echo off
REM filepath: /c:/Users/Administrator/Desktop/ffi-napi/clean-build.bat
echo ========================================
echo 清理构建文件
echo ========================================
echo.
echo 步骤 1: 结束可能占用文件的进程...
taskkill /F /IM "FFI-NAPI App.exe" 2>nul
taskkill /F /IM electron.exe 2>nul
timeout /t 2 /nobreak >nul
echo.
echo 步骤 2: 删除 dist 目录...
if exist dist (
echo 正在删除 dist 文件夹...
rmdir /s /q dist 2>nul
if exist dist (
echo 第一次删除失败,等待 3 秒后重试...
timeout /t 3 /nobreak >nul
rmdir /s /q dist 2>nul
)
)
if exist dist (
echo 警告: dist 目录仍然存在,可能有文件被占用
echo 请手动关闭所有相关程序后重试
pause
exit /b 1
) else (
echo dist 目录清理成功!
)
echo.
echo 步骤 3: 删除临时文件...
if exist node_modules\.cache rmdir /s /q node_modules\.cache 2>nul
echo.
echo ========================================
echo 清理完成!现在可以重新构建
echo ========================================
echo.
pause