-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.bat
More file actions
32 lines (30 loc) · 962 Bytes
/
run.bat
File metadata and controls
32 lines (30 loc) · 962 Bytes
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
@echo off
rem Check if the run_config.txt file exists
if exist ".\run_config.txt" (
rem If the file exists, read the script name from it
set /p scriptName=<".\run_config.txt"
goto startScript
) else (
rem If the file does not exist, install the requirements and prompt the user to select an option
echo Installing requirements from requirements.txt...
pip install -r requirements.txt
echo Running main script...
echo Select option:
echo 1. Run default script (main.py)
echo 2. Specify custom script name
set /p scriptOption=
if "%scriptOption%" == "1" (
set scriptName=main.py
) else (
if "%scriptOption%" == "2" (
set /p scriptName=Enter script name:
)
)
rem Write the script name to the run_config.txt file
echo %scriptName% > ".\run_config.txt"
)
:startScript
rem Run the script specified by the user (or main.py if the user selected that option)
echo Running %scriptName%...
python %scriptName%
echo Done!