-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.bat
More file actions
37 lines (29 loc) · 908 Bytes
/
export.bat
File metadata and controls
37 lines (29 loc) · 908 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
33
34
35
36
37
@echo off
rem Function to check if Poetry is installed
call :check_poetry_installed
if errorlevel 1 exit /b 1
rem Get the optional parameter if provided
set "environment=%~1"
rem Run the appropriate export command based on the parameter
call :export_dependencies "%environment%"
exit /b 0
:check_poetry_installed
poetry --version >nul 2>&1
if errorlevel 1 (
echo Poetry is not installed. Please install it and try again.
exit /b 1
)
exit /b 0
:export_dependencies
setlocal
set "option=%~1"
if not "%option%"=="--prod" (
echo Exporting development dependencies using Poetry...
poetry export --with dev,test -f requirements.txt -o requirements\local.txt
)
if not "%option%"=="--dev" if not "%option%"=="--dev-binary" (
echo Exporting production dependencies using Poetry...
poetry export --with production -f requirements.txt -o requirements\production.txt
)
endlocal
exit /b 0