-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.bat
More file actions
63 lines (56 loc) · 1.53 KB
/
Copy pathmake.bat
File metadata and controls
63 lines (56 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@echo off
if "%1"=="install" goto install
if "%1"=="dev-backend" goto dev-backend
if "%1"=="dev-web" goto dev-web
if "%1"=="build-web" goto build-web
if "%1"=="package" goto package
if "%1"=="run-prod" goto run-prod
if "%1"=="help" goto help
if "%1"=="" goto help
:install
if not exist venv (
python -m venv venv
)
call venv\Scripts\activate
pip install -e .
cd web && bun install
goto :eof
:dev-backend
call venv\Scripts\activate
python run.py
goto :eof
:dev-web
cd web && bun run dev
goto :eof
:build-web
cd web && bun run build
goto :eof
:package
call :build-web
if exist src\bit_by_mail\frontend\dist rmdir /s /q src\bit_by_mail\frontend\dist
if not exist src\bit_by_mail\frontend mkdir src\bit_by_mail\frontend
xcopy web\dist src\bit_by_mail\frontend\dist\ /E /I /H /Y
if exist venv (
call venv\Scripts\activate
pip install --upgrade build
python -m build
) else (
pip install --upgrade build
python -m build
)
goto :eof
:run-prod
call :package
call venv\Scripts\activate
for %%f in (dist\*.whl) do pip install "%%f" --force-reinstall
bit-by-mail
goto :eof
:help
echo Available commands:
echo install - Install all backend and web dependencies.
echo dev-backend - Start the backend server for development.
echo dev-web - Start the web server for development.
echo run-prod - Build, package, and run the application for production.
echo build-web - Build the web assets for production.
echo package - Build the final Python package for distribution.
goto :eof