-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.bat
48 lines (38 loc) · 1.03 KB
/
start.bat
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
@echo off
setlocal enabledelayedexpansion
:: Check if conda is installed
where conda >nul 2>nul
if %errorlevel% neq 0 (
echo "conda is not installed. Please install Anaconda or Miniconda first."
exit /b 1
)
:: Check if main.py exists in current directory
if not exist "ats/main.py" (
echo "ats/main.py not found in current directory."
exit /b 1
)
:: set environment name
set env_name="ats"
:: Check if environment exists
conda env list | findstr /C:"!env_name! " >nul 2>&1
if %errorlevel% neq 0 (
echo "Environment '!env_name!' does not exist."
exit /b 1
)
:: Activate conda environment
echo "Activating conda environment '!env_name!'..."
call conda activate !env_name!
echo "Successfully activated environment '!env_name!'"
:: Run main.py
echo "Starting the Program..."
call python -m ats.main
if %errorlevel% equ 0 (
echo "Program executed successfully!"
) else (
echo "Error occurred while running main.py"
call conda deactivate
exit /b 1
)
:: Deactivate environment
call conda deactivate
exit /b 0