1315b9658Sopenharmony_ci@if "%DEBUG%" == "" @echo off
2315b9658Sopenharmony_ci@rem ##########################################################################
3315b9658Sopenharmony_ci@rem
4315b9658Sopenharmony_ci@rem  Hvigor startup script for Windows
5315b9658Sopenharmony_ci@rem
6315b9658Sopenharmony_ci@rem ##########################################################################
7315b9658Sopenharmony_ci
8315b9658Sopenharmony_ci@rem Set local scope for the variables with windows NT shell
9315b9658Sopenharmony_ciif "%OS%"=="Windows_NT" setlocal
10315b9658Sopenharmony_ci
11315b9658Sopenharmony_ciset DIRNAME=%~dp0
12315b9658Sopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
13315b9658Sopenharmony_ciset APP_BASE_NAME=%~n0
14315b9658Sopenharmony_ciset APP_HOME=%DIRNAME%
15315b9658Sopenharmony_ci
16315b9658Sopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
17315b9658Sopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
18315b9658Sopenharmony_ci
19315b9658Sopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
20315b9658Sopenharmony_ciset NODE_EXE=node.exe
21315b9658Sopenharmony_ci
22315b9658Sopenharmony_cigoto start
23315b9658Sopenharmony_ci
24315b9658Sopenharmony_ci:start
25315b9658Sopenharmony_ci@rem Find node.exe
26315b9658Sopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
27315b9658Sopenharmony_ci
28315b9658Sopenharmony_ci%NODE_EXE% --version >NUL 2>&1
29315b9658Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
30315b9658Sopenharmony_ci
31315b9658Sopenharmony_ciecho.
32315b9658Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
33315b9658Sopenharmony_ciecho.
34315b9658Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
35315b9658Sopenharmony_ciecho location of your NodeJs installation.
36315b9658Sopenharmony_ci
37315b9658Sopenharmony_cigoto fail
38315b9658Sopenharmony_ci
39315b9658Sopenharmony_ci:findNodeFromNodeHome
40315b9658Sopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
41315b9658Sopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
42315b9658Sopenharmony_ci
43315b9658Sopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
44315b9658Sopenharmony_ciecho.
45315b9658Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
46315b9658Sopenharmony_ciecho.
47315b9658Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
48315b9658Sopenharmony_ciecho location of your NodeJs installation.
49315b9658Sopenharmony_ci
50315b9658Sopenharmony_cigoto fail
51315b9658Sopenharmony_ci
52315b9658Sopenharmony_ci:execute
53315b9658Sopenharmony_ci@rem Execute hvigor
54315b9658Sopenharmony_ci"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
55315b9658Sopenharmony_ci
56315b9658Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
57315b9658Sopenharmony_ci
58315b9658Sopenharmony_ci:fail
59315b9658Sopenharmony_ciexit /b 1
60315b9658Sopenharmony_ci
61315b9658Sopenharmony_ci:hvigorwEnd
62315b9658Sopenharmony_ciif "%OS%" == "Windows_NT" endlocal
63315b9658Sopenharmony_ci
64315b9658Sopenharmony_ci:end
65