-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cmd
34 lines (27 loc) · 913 Bytes
/
setup.cmd
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
@echo off
setlocal enabledelayedexpansion
:: Set paths
set SOURCE_FOLDER=functions
set COMPILED_FOLDER=compiled_functions
:: Ensure the compiled_functions folder exists
if not exist "%COMPILED_FOLDER%" (
echo Creating the compiled_functions folder...
mkdir "%COMPILED_FOLDER%"
)
:: Loop through all .py files in the source folder
for %%f in (%SOURCE_FOLDER%\*.py) do (
:: Get the base filename (without extension)
set FILE_NAME=%%~nf
:: Run mypyc on the current file
echo Compiling %%f with mypyc...
mypyc %%f
:: Check if the .pyd file exists in the source folder after compilation
if exist "!FILE_NAME!*.pyd" (
echo Moving !FILE_NAME! to the compiled_functions folder...
move /Y "!FILE_NAME!*.pyd" "%COMPILED_FOLDER%\"
) else (
echo No .pyd file generated for !FILE_NAME!...
)
echo.
)
echo All files compiled and moved successfully.