10fbfc30aSopenharmony_ci@if "%DEBUG%" == "" @echo off
20fbfc30aSopenharmony_ci@rem ##########################################################################
30fbfc30aSopenharmony_ci@rem
40fbfc30aSopenharmony_ci@rem  Hvigor startup script for Windows
50fbfc30aSopenharmony_ci@rem
60fbfc30aSopenharmony_ci@rem ##########################################################################
70fbfc30aSopenharmony_ci
80fbfc30aSopenharmony_ci@rem Set local scope for the variables with windows NT shell
90fbfc30aSopenharmony_ciif "%OS%"=="Windows_NT" setlocal
100fbfc30aSopenharmony_ci
110fbfc30aSopenharmony_ciset DIRNAME=%~dp0
120fbfc30aSopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
130fbfc30aSopenharmony_ciset APP_BASE_NAME=%~n0
140fbfc30aSopenharmony_ciset APP_HOME=%DIRNAME%
150fbfc30aSopenharmony_ci
160fbfc30aSopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
170fbfc30aSopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
180fbfc30aSopenharmony_ci
190fbfc30aSopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
200fbfc30aSopenharmony_ciset NODE_EXE=node.exe
210fbfc30aSopenharmony_ci
220fbfc30aSopenharmony_cigoto start
230fbfc30aSopenharmony_ci
240fbfc30aSopenharmony_ci:start
250fbfc30aSopenharmony_ci@rem Find node.exe
260fbfc30aSopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
270fbfc30aSopenharmony_ci
280fbfc30aSopenharmony_ci%NODE_EXE% --version >NUL 2>&1
290fbfc30aSopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
300fbfc30aSopenharmony_ci
310fbfc30aSopenharmony_ciecho.
320fbfc30aSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
330fbfc30aSopenharmony_ciecho.
340fbfc30aSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
350fbfc30aSopenharmony_ciecho location of your NodeJs installation.
360fbfc30aSopenharmony_ci
370fbfc30aSopenharmony_cigoto fail
380fbfc30aSopenharmony_ci
390fbfc30aSopenharmony_ci:findNodeFromNodeHome
400fbfc30aSopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
410fbfc30aSopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
420fbfc30aSopenharmony_ci
430fbfc30aSopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
440fbfc30aSopenharmony_ciecho.
450fbfc30aSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
460fbfc30aSopenharmony_ciecho.
470fbfc30aSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
480fbfc30aSopenharmony_ciecho location of your NodeJs installation.
490fbfc30aSopenharmony_ci
500fbfc30aSopenharmony_cigoto fail
510fbfc30aSopenharmony_ci
520fbfc30aSopenharmony_ci:execute
530fbfc30aSopenharmony_ci@rem Execute hvigor
540fbfc30aSopenharmony_ci"%NODE_EXE%" "%WRAPPER_MODULE_PATH%" %*
550fbfc30aSopenharmony_ci
560fbfc30aSopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
570fbfc30aSopenharmony_ci
580fbfc30aSopenharmony_ci:fail
590fbfc30aSopenharmony_ciexit /b 1
600fbfc30aSopenharmony_ci
610fbfc30aSopenharmony_ci:hvigorwEnd
620fbfc30aSopenharmony_ciif "%OS%" == "Windows_NT" endlocal
630fbfc30aSopenharmony_ci
640fbfc30aSopenharmony_ci:end
65