16e80583aSopenharmony_ci@if "%DEBUG%" == "" @echo off
26e80583aSopenharmony_ci@rem ##########################################################################
36e80583aSopenharmony_ci@rem
46e80583aSopenharmony_ci@rem  Hvigor startup script for Windows
56e80583aSopenharmony_ci@rem
66e80583aSopenharmony_ci@rem ##########################################################################
76e80583aSopenharmony_ci
86e80583aSopenharmony_ci@rem Set local scope for the variables with windows NT shell
96e80583aSopenharmony_ciif "%OS%"=="Windows_NT" setlocal
106e80583aSopenharmony_ci
116e80583aSopenharmony_ciset DIRNAME=%~dp0
126e80583aSopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
136e80583aSopenharmony_ciset APP_BASE_NAME=%~n0
146e80583aSopenharmony_ciset APP_HOME=%DIRNAME%
156e80583aSopenharmony_ci
166e80583aSopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
176e80583aSopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
186e80583aSopenharmony_ci
196e80583aSopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
206e80583aSopenharmony_ciset NODE_EXE=node.exe
216e80583aSopenharmony_ci
226e80583aSopenharmony_cigoto start
236e80583aSopenharmony_ci
246e80583aSopenharmony_ci:start
256e80583aSopenharmony_ci@rem Find node.exe
266e80583aSopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
276e80583aSopenharmony_ci
286e80583aSopenharmony_ci%NODE_EXE% --version >NUL 2>&1
296e80583aSopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
306e80583aSopenharmony_ci
316e80583aSopenharmony_ciecho.
326e80583aSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
336e80583aSopenharmony_ciecho.
346e80583aSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
356e80583aSopenharmony_ciecho location of your NodeJs installation.
366e80583aSopenharmony_ci
376e80583aSopenharmony_cigoto fail
386e80583aSopenharmony_ci
396e80583aSopenharmony_ci:findNodeFromNodeHome
406e80583aSopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
416e80583aSopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
426e80583aSopenharmony_ci
436e80583aSopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
446e80583aSopenharmony_ciecho.
456e80583aSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
466e80583aSopenharmony_ciecho.
476e80583aSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
486e80583aSopenharmony_ciecho location of your NodeJs installation.
496e80583aSopenharmony_ci
506e80583aSopenharmony_cigoto fail
516e80583aSopenharmony_ci
526e80583aSopenharmony_ci:execute
536e80583aSopenharmony_ci@rem Execute hvigor
546e80583aSopenharmony_ci"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
556e80583aSopenharmony_ci
566e80583aSopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
576e80583aSopenharmony_ci
586e80583aSopenharmony_ci:fail
596e80583aSopenharmony_ciexit /b 1
606e80583aSopenharmony_ci
616e80583aSopenharmony_ci:hvigorwEnd
626e80583aSopenharmony_ciif "%OS%" == "Windows_NT" endlocal
636e80583aSopenharmony_ci
646e80583aSopenharmony_ci:end
65