-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGeigerLog.bat
executable file
·57 lines (46 loc) · 1.65 KB
/
GeigerLog.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
49
50
51
52
53
54
55
56
57
@echo OFF
@REM script: GeigerLog.bat
@REM Clear Screen
cls
echo. ############################################ GeigerLog Startup #############################################
@REM Working Dir
set mypwd=%cd%
echo. Checking for Working Directory
echo. Current Directory: %mypwd%
if exist geigerlog.py (
echo. Found file 'geigerlog.py'; taking this as GeigerLog working directory!
) else (
echo.
echo. This is NOT your working directory for GeigerLog!
echo. Please change into the GeigerLog working directory, and then start GeigerLog again.
echo.
exit 1
)
@REM Virtual Environment
set myvenv=__venvGL1_5_0
echo. Checking for Virtual Environment
@REM Checking for command 'setup'
if "%~1"=="" (
@REM no param given on command line
) else (
if "%~1"=="setup" (
echo. GeigerLog Auto-Setup
if exist __venvGL1_5_0\Scripts\activate (
echo. A Virtual Environment does already exist as: '%myvenv%'
) else (
echo. A Virtual Environment does NOT exist - now creating it as: '%myvenv%'
@REM allow the use of system-site-packages (needed at least for Raspi)
python -m venv --system-site-packages __venvGL1_5_0
echo. Done
)
)
)
@REM if venv exists start GeigerLog; install modules if needed
@REM if command 'setup' had been given, it is still active!
if exist __venvGL1_5_0\Scripts\activate (
echo. Using Virtual Environment '%myvenv%'
%myvenv%\Scripts\python geigerlog.py %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
echo. A Virtual Environment does NOT exist - Please, start GeigerLog with 'GeigerLog.bat setup'
)
echo.