-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDEBUG.bat
More file actions
64 lines (55 loc) · 2.15 KB
/
DEBUG.bat
File metadata and controls
64 lines (55 loc) · 2.15 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
64
@echo off
REM ==================================================================
REM == Flowork Developer Debug Launcher (FINAL WITH PROGRESS) ==
REM =============================================================
title Flowork (DEBUG MODE)
echo [INFO] Running in DEBUG mode with a full portable environment...
cd /d "%~dp0"
REM --- Define path to the full portable Python ---
SET "PORTABLE_PYTHON=%~dp0python\python.exe"
REM --- Force PATH to use our local portable tools FIRST ---
echo [INFO] Forcing PATH to use local portable Python...
SET "PATH=%~dp0python;%~dp0python\Scripts;%PATH%"
REM --- Pre-flight Check ---
IF NOT EXIST "%PORTABLE_PYTHON%" (
echo [FATAL] Portable Python not found at: %PORTABLE_PYTHON%
pause
exit /b
)
REM --- Step 1: Bootstrap Poetry if missing ---
echo [INFO] Checking for Poetry...
poetry --version >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
echo [WARN] Poetry not found. Installing it into the portable environment...
echo [INFO] This may take a few minutes. Please wait for pip to finish downloading...
REM (FIX) Removed the '--quiet' flag to show real-time download and installation progress.
python -m pip install poetry
) ELSE (
echo [INFO] Poetry is already available.
)
REM --- Step 2: Configure Poetry to create .venv locally ---
echo [INFO] Configuring Poetry to create virtual environment inside the project...
poetry config virtualenvs.in-project true --local
IF %ERRORLEVEL% NEQ 0 (
echo [FATAL] Failed to configure Poetry.
pause
exit /b
)
REM --- Step 3: Sync project dependencies ---
echo [INFO] Syncing project dependencies...
poetry install --no-root
IF %ERRORLEVEL% NEQ 0 (
echo [FATAL] 'poetry install' failed. Check your internet or poetry.lock file.
pause
exit /b
)
REM --- Step 4: Run the main application ---
echo [INFO] Starting the main Flowork application...
echo -------------------------------------------------------------
echo.
SET "VENV_PYTHON=%~dp0.venv\Scripts\python.exe"
"%VENV_PYTHON%" main.py
echo.
echo -------------------------------------------------------------
[INFO] The Flowork application has closed.
pause