1e75ebbc8Sopenharmony_ci@if "%DEBUG%" == "" @echo off
2e75ebbc8Sopenharmony_ci@rem ##########################################################################
3e75ebbc8Sopenharmony_ci@rem
4e75ebbc8Sopenharmony_ci@rem  Hvigor startup script for Windows
5e75ebbc8Sopenharmony_ci@rem
6e75ebbc8Sopenharmony_ci@rem ##########################################################################
7e75ebbc8Sopenharmony_ci
8e75ebbc8Sopenharmony_ci@rem Set local scope for the variables with windows NT shell
9e75ebbc8Sopenharmony_ciif "%OS%"=="Windows_NT" setlocal
10e75ebbc8Sopenharmony_ci
11e75ebbc8Sopenharmony_ciset DIRNAME=%~dp0
12e75ebbc8Sopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
13e75ebbc8Sopenharmony_ciset APP_BASE_NAME=%~n0
14e75ebbc8Sopenharmony_ciset APP_HOME=%DIRNAME%
15e75ebbc8Sopenharmony_ci
16e75ebbc8Sopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
17e75ebbc8Sopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
18e75ebbc8Sopenharmony_ci
19e75ebbc8Sopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
20e75ebbc8Sopenharmony_ciset NODE_EXE=node.exe
21e75ebbc8Sopenharmony_ci
22e75ebbc8Sopenharmony_cigoto start
23e75ebbc8Sopenharmony_ci
24e75ebbc8Sopenharmony_ci:start
25e75ebbc8Sopenharmony_ci@rem Find node.exe
26e75ebbc8Sopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
27e75ebbc8Sopenharmony_ci
28e75ebbc8Sopenharmony_ci%NODE_EXE% --version >NUL 2>&1
29e75ebbc8Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
30e75ebbc8Sopenharmony_ci
31e75ebbc8Sopenharmony_ciecho.
32e75ebbc8Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
33e75ebbc8Sopenharmony_ciecho.
34e75ebbc8Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
35e75ebbc8Sopenharmony_ciecho location of your NodeJs installation.
36e75ebbc8Sopenharmony_ci
37e75ebbc8Sopenharmony_cigoto fail
38e75ebbc8Sopenharmony_ci
39e75ebbc8Sopenharmony_ci:findNodeFromNodeHome
40e75ebbc8Sopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
41e75ebbc8Sopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
42e75ebbc8Sopenharmony_ci
43e75ebbc8Sopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
44e75ebbc8Sopenharmony_ciecho.
45e75ebbc8Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
46e75ebbc8Sopenharmony_ciecho.
47e75ebbc8Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
48e75ebbc8Sopenharmony_ciecho location of your NodeJs installation.
49e75ebbc8Sopenharmony_ci
50e75ebbc8Sopenharmony_cigoto fail
51e75ebbc8Sopenharmony_ci
52e75ebbc8Sopenharmony_ci:execute
53e75ebbc8Sopenharmony_ci@rem Execute hvigor
54e75ebbc8Sopenharmony_ci"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
55e75ebbc8Sopenharmony_ci
56e75ebbc8Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
57e75ebbc8Sopenharmony_ci
58e75ebbc8Sopenharmony_ci:fail
59e75ebbc8Sopenharmony_ciexit /b 1
60e75ebbc8Sopenharmony_ci
61e75ebbc8Sopenharmony_ci:hvigorwEnd
62e75ebbc8Sopenharmony_ciif "%OS%" == "Windows_NT" endlocal
63e75ebbc8Sopenharmony_ci
64e75ebbc8Sopenharmony_ci:end
65