194f5b7a1Sopenharmony_ci@if "%DEBUG%" == "" @echo off
294f5b7a1Sopenharmony_ci@rem ##########################################################################
394f5b7a1Sopenharmony_ci@rem
494f5b7a1Sopenharmony_ci@rem  Hvigor startup script for Windows
594f5b7a1Sopenharmony_ci@rem
694f5b7a1Sopenharmony_ci@rem ##########################################################################
794f5b7a1Sopenharmony_ci
894f5b7a1Sopenharmony_ci@rem Set local scope for the variables with windows NT shell
994f5b7a1Sopenharmony_ciif "%OS%"=="Windows_NT" setlocal
1094f5b7a1Sopenharmony_ci
1194f5b7a1Sopenharmony_ciset DIRNAME=%~dp0
1294f5b7a1Sopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
1394f5b7a1Sopenharmony_ciset APP_BASE_NAME=%~n0
1494f5b7a1Sopenharmony_ciset APP_HOME=%DIRNAME%
1594f5b7a1Sopenharmony_ci
1694f5b7a1Sopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
1794f5b7a1Sopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
1894f5b7a1Sopenharmony_ci
1994f5b7a1Sopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
2094f5b7a1Sopenharmony_ciset NODE_EXE=node.exe
2194f5b7a1Sopenharmony_ci
2294f5b7a1Sopenharmony_cigoto start
2394f5b7a1Sopenharmony_ci
2494f5b7a1Sopenharmony_ci:start
2594f5b7a1Sopenharmony_ci@rem Find node.exe
2694f5b7a1Sopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
2794f5b7a1Sopenharmony_ci
2894f5b7a1Sopenharmony_ci%NODE_EXE% --version >NUL 2>&1
2994f5b7a1Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
3094f5b7a1Sopenharmony_ci
3194f5b7a1Sopenharmony_ciecho.
3294f5b7a1Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
3394f5b7a1Sopenharmony_ciecho.
3494f5b7a1Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
3594f5b7a1Sopenharmony_ciecho location of your NodeJs installation.
3694f5b7a1Sopenharmony_ci
3794f5b7a1Sopenharmony_cigoto fail
3894f5b7a1Sopenharmony_ci
3994f5b7a1Sopenharmony_ci:findNodeFromNodeHome
4094f5b7a1Sopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
4194f5b7a1Sopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
4294f5b7a1Sopenharmony_ci
4394f5b7a1Sopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
4494f5b7a1Sopenharmony_ciecho.
4594f5b7a1Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
4694f5b7a1Sopenharmony_ciecho.
4794f5b7a1Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
4894f5b7a1Sopenharmony_ciecho location of your NodeJs installation.
4994f5b7a1Sopenharmony_ci
5094f5b7a1Sopenharmony_cigoto fail
5194f5b7a1Sopenharmony_ci
5294f5b7a1Sopenharmony_ci:execute
5394f5b7a1Sopenharmony_ci@rem Execute hvigor
5494f5b7a1Sopenharmony_ci"%NODE_EXE%" "%WRAPPER_MODULE_PATH%" %*
5594f5b7a1Sopenharmony_ci
5694f5b7a1Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
5794f5b7a1Sopenharmony_ci
5894f5b7a1Sopenharmony_ci:fail
5994f5b7a1Sopenharmony_ciexit /b 1
6094f5b7a1Sopenharmony_ci
6194f5b7a1Sopenharmony_ci:hvigorwEnd
6294f5b7a1Sopenharmony_ciif "%OS%" == "Windows_NT" endlocal
6394f5b7a1Sopenharmony_ci
6494f5b7a1Sopenharmony_ci:end
65