caps_enhancer/server/pack-zip.bat
2026-03-23 15:36:40 +03:00

40 lines
1.3 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
setlocal
set ROOT=%~dp0..
:: Читаем версию из manifest.json
for /f "delims=" %%v in ('powershell -NoProfile -Command "(Get-Content '%ROOT%\manifest.json' | ConvertFrom-Json).version"') do set VERSION=%%v
echo Упаковка версии %VERSION%...
:: Временная папка
set TMP=%TEMP%\caps-enhancer-pack
if exist "%TMP%" rd /s /q "%TMP%"
md "%TMP%"
:: Копируем файлы расширения
copy "%ROOT%\manifest.json" "%TMP%\" >nul
copy "%ROOT%\popup.html" "%TMP%\" >nul
copy "%ROOT%\popup.css" "%TMP%\" >nul
copy "%ROOT%\options.html" "%TMP%\" >nul
copy "%ROOT%\auto-update.bat" "%TMP%\" >nul
xcopy "%ROOT%\js" "%TMP%\js\" /e /q >nul
xcopy "%ROOT%\css" "%TMP%\css\" /e /q >nul
xcopy "%ROOT%\modules" "%TMP%\modules\" /e /q >nul
xcopy "%ROOT%\icons" "%TMP%\icons\" /e /q >nul
:: Создаём ZIP
set OUT=%~dp0caps-enhancer.zip
if exist "%OUT%" del "%OUT%"
powershell -NoProfile -Command "Compress-Archive -Path '%TMP%\*' -DestinationPath '%OUT%'"
rd /s /q "%TMP%"
:: Обновляем version.json
echo {"version": "%VERSION%"} > "%~dp0version.json"
echo.
echo [OK] server\caps-enhancer.zip
echo [OK] server\version.json (v%VERSION%)
echo.
echo Залей оба файла на сервер: /var/www/caps_enhancer/
pause
endlocal