18779efd5Sopenharmony_ci@if "%DEBUG%" == "" @echo off
28779efd5Sopenharmony_ci@rem ##########################################################################
38779efd5Sopenharmony_ci@rem
48779efd5Sopenharmony_ci@rem  Hvigor startup script for Windows
58779efd5Sopenharmony_ci@rem
68779efd5Sopenharmony_ci@rem ##########################################################################
78779efd5Sopenharmony_ci
88779efd5Sopenharmony_ci@rem Set local scope for the variables with windows NT shell
98779efd5Sopenharmony_ciif "%OS%"=="Windows_NT" setlocal
108779efd5Sopenharmony_ci
118779efd5Sopenharmony_ciset DIRNAME=%~dp0
128779efd5Sopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
138779efd5Sopenharmony_ciset APP_BASE_NAME=%~n0
148779efd5Sopenharmony_ciset APP_HOME=%DIRNAME%
158779efd5Sopenharmony_ci
168779efd5Sopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
178779efd5Sopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
188779efd5Sopenharmony_ci
198779efd5Sopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
208779efd5Sopenharmony_ciset NODE_EXE=node.exe
218779efd5Sopenharmony_ci
228779efd5Sopenharmony_cigoto start
238779efd5Sopenharmony_ci
248779efd5Sopenharmony_ci:start
258779efd5Sopenharmony_ci@rem Find node.exe
268779efd5Sopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
278779efd5Sopenharmony_ci
288779efd5Sopenharmony_ci%NODE_EXE% --version >NUL 2>&1
298779efd5Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
308779efd5Sopenharmony_ci
318779efd5Sopenharmony_ciecho.
328779efd5Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
338779efd5Sopenharmony_ciecho.
348779efd5Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
358779efd5Sopenharmony_ciecho location of your NodeJs installation.
368779efd5Sopenharmony_ci
378779efd5Sopenharmony_cigoto fail
388779efd5Sopenharmony_ci
398779efd5Sopenharmony_ci:findNodeFromNodeHome
408779efd5Sopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
418779efd5Sopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
428779efd5Sopenharmony_ci
438779efd5Sopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
448779efd5Sopenharmony_ciecho.
458779efd5Sopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
468779efd5Sopenharmony_ciecho.
478779efd5Sopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
488779efd5Sopenharmony_ciecho location of your NodeJs installation.
498779efd5Sopenharmony_ci
508779efd5Sopenharmony_cigoto fail
518779efd5Sopenharmony_ci
528779efd5Sopenharmony_ci:execute
538779efd5Sopenharmony_ci@rem Execute hvigor
548779efd5Sopenharmony_ci"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
558779efd5Sopenharmony_ci
568779efd5Sopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
578779efd5Sopenharmony_ci
588779efd5Sopenharmony_ci:fail
598779efd5Sopenharmony_ciexit /b 1
608779efd5Sopenharmony_ci
618779efd5Sopenharmony_ci:hvigorwEnd
628779efd5Sopenharmony_ciif "%OS%" == "Windows_NT" endlocal
638779efd5Sopenharmony_ci
648779efd5Sopenharmony_ci:end
65