-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmetacall.bat
68 lines (63 loc) · 2.6 KB
/
metacall.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
58
59
60
61
62
63
64
65
66
67
68
@echo off
setlocal
set "loc=%~dp0metacall"
rem Windows PATH
set "PATH=%SystemRoot%;%SystemRoot%\System32;%SystemRoot%\System32\Wbem"
rem MetaCall
set "PATH=%PATH%;%loc%;%loc%\lib"
rem Python
set "PYTHONHOME=%loc%\runtimes\python"
set "PIP_TARGET=%loc%\runtimes\python\Lib\site-packages"
set "PATH=%PATH%;%loc%\runtimes\python;%loc%\runtimes\python\Scripts;%loc%\runtimes\python\Lib\site-packages\bin"
rem NodeJS
set "PATH=%PATH%;%loc%\lib\runtimes\nodejs;%loc%\lib\runtimes\nodejs\lib"
rem Ruby
set "PATH=%PATH%;%loc%\runtimes\ruby\bin;%loc%\runtimes\ruby\bin;%loc%\runtimes\ruby\bin\ruby_builtin_dlls"
rem DotNet Core
set "PATH=%PATH%;%loc%\lib\runtimes\dotnet;%loc%\lib\runtimes\dotnet\host\fxr\5.0.12"
rem Package Managers Paths
set pip_path="%loc%\runtimes\python\python.exe" -m pip
set pip3_path="%loc%\runtimes\python\python.exe" -m pip
set npm_path="%loc%\runtimes\nodejs\npm.cmd"
set npx_path="%loc%\runtimes\nodejs\npx.cmd"
set bundle_path="%loc%\runtimes\ruby\bin\bundle.bat"
set bundler_path="%loc%\runtimes\ruby\bin\bundler.bat"
set erb_path="%loc%\runtimes\ruby\bin\erb.bat"
set gem_path="%loc%\runtimes\ruby\bin\gem.cmd"
set irb_path="%loc%\runtimes\ruby\bin\irb.bat"
set racc_path="%loc%\runtimes\ruby\bin\racc.bat"
set rake_path="%loc%\runtimes\ruby\bin\rake.bat"
set rbs_path="%loc%\runtimes\ruby\bin\rbs.bat"
set rdbg_path="%loc%\runtimes\ruby\bin\rdbg.bat"
set rdoc_path="%loc%\runtimes\ruby\bin\rdoc.bat"
set ri_path="%loc%\runtimes\ruby\bin\ri.bat"
set typeprof_path="%loc%\runtimes\ruby\bin\typeprof.bat"
rem TODO: set nuget_path="%loc%\runtimes\dotnet\nuget.exe"
rem Additional Packages Paths
set deploy_path="%~dp0\deps\deploy\metacall-deploy.cmd"
set faas_path="%~dp0\deps\faas\metacall-faas.cmd"
rem Check if it is running a package manager (or related binary) and execute it
for /f "tokens=1,* delims= " %%a in ("%*") do set SUBPROGRAM_PARAMETERS=%%b
setlocal ENABLEDELAYEDEXPANSION
set package_manager=^^^!%1_path^^^!
if not [%package_manager%]==[] (
echo call %package_manager% %SUBPROGRAM_PARAMETERS%
call %package_manager% %SUBPROGRAM_PARAMETERS%
set code=%errorlevel%
endlocal && set code=%code%
exit /b %code%
)
endlocal
rem MetaCall Enviroment
set "CORE_ROOT=%loc%\runtimes\dotnet\shared\Microsoft.NETCore.App\5.0.12"
set "LOADER_LIBRARY_PATH=%loc%\lib"
set "SERIAL_LIBRARY_PATH=%loc%\lib"
set "DETOUR_LIBRARY_PATH=%loc%\lib"
set "PORT_LIBRARY_PATH=%loc%\lib"
set "CONFIGURATION_PATH=%loc%\configurations\global.json"
if not defined LOADER_SCRIPT_PATH (
set "LOADER_SCRIPT_PATH=%cd%"
)
rem Execute MetaCall CLI
"%loc%\metacallcli.exe" %*
endlocal