16e7c69efSopenharmony_ci:: Copyright (c) 2023 Huawei Device Co., Ltd.
26e7c69efSopenharmony_ci:: Licensed under the Apache License, Version 2.0 (the "License");
36e7c69efSopenharmony_ci:: you may not use this file except in compliance with the License.
46e7c69efSopenharmony_ci:: You may obtain a copy of the License at
56e7c69efSopenharmony_ci::
66e7c69efSopenharmony_ci::  http://www.apache.org/licenses/LICENSE-2.0
76e7c69efSopenharmony_ci::
86e7c69efSopenharmony_ci:: Unless required by applicable law or agreed to in writing, software
96e7c69efSopenharmony_ci:: distributed under the License is distributed on an "AS IS" BASIS,
106e7c69efSopenharmony_ci:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116e7c69efSopenharmony_ci:: See the License for the specific language governing permissions and
126e7c69efSopenharmony_ci:: limitations under the License.
136e7c69efSopenharmony_ci
146e7c69efSopenharmony_ci@if "%DEBUG%" == "" @echo off
156e7c69efSopenharmony_ci@rem ##########################################################################
166e7c69efSopenharmony_ci@rem
176e7c69efSopenharmony_ci@rem  Hvigor startup script for Windows
186e7c69efSopenharmony_ci@rem
196e7c69efSopenharmony_ci@rem ##########################################################################
206e7c69efSopenharmony_ci
216e7c69efSopenharmony_ci@rem Set local scope for the variables with windows NT shell
226e7c69efSopenharmony_ciif "%OS%"=="Windows_NT" setlocal
236e7c69efSopenharmony_ci
246e7c69efSopenharmony_ciset DIRNAME=%~dp0
256e7c69efSopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
266e7c69efSopenharmony_ciset APP_BASE_NAME=%~n0
276e7c69efSopenharmony_ciset APP_HOME=%DIRNAME%
286e7c69efSopenharmony_ci
296e7c69efSopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
306e7c69efSopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
316e7c69efSopenharmony_ci
326e7c69efSopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
336e7c69efSopenharmony_ciset NODE_EXE=node.exe
346e7c69efSopenharmony_ci
356e7c69efSopenharmony_cigoto start
366e7c69efSopenharmony_ci
376e7c69efSopenharmony_ci:start
386e7c69efSopenharmony_ci@rem Find node.exe
396e7c69efSopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
406e7c69efSopenharmony_ci
416e7c69efSopenharmony_ci%NODE_EXE% --version >NUL 2>&1
426e7c69efSopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
436e7c69efSopenharmony_ci
446e7c69efSopenharmony_ciecho.
456e7c69efSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
466e7c69efSopenharmony_ciecho.
476e7c69efSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
486e7c69efSopenharmony_ciecho location of your NodeJs installation.
496e7c69efSopenharmony_ci
506e7c69efSopenharmony_cigoto fail
516e7c69efSopenharmony_ci
526e7c69efSopenharmony_ci:findNodeFromNodeHome
536e7c69efSopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
546e7c69efSopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
556e7c69efSopenharmony_ci
566e7c69efSopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
576e7c69efSopenharmony_ciecho.
586e7c69efSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
596e7c69efSopenharmony_ciecho.
606e7c69efSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
616e7c69efSopenharmony_ciecho location of your NodeJs installation.
626e7c69efSopenharmony_ci
636e7c69efSopenharmony_cigoto fail
646e7c69efSopenharmony_ci
656e7c69efSopenharmony_ci:execute
666e7c69efSopenharmony_ci@rem Execute hvigor
676e7c69efSopenharmony_ci"%NODE_EXE%" "%WRAPPER_MODULE_PATH%" %*
686e7c69efSopenharmony_ci
696e7c69efSopenharmony_ciif "%ERRORLEVEL%" == "0" goto hvigorwEnd
706e7c69efSopenharmony_ci
716e7c69efSopenharmony_ci:fail
726e7c69efSopenharmony_ciexit /b 1
736e7c69efSopenharmony_ci
746e7c69efSopenharmony_ci:hvigorwEnd
756e7c69efSopenharmony_ciif "%OS%" == "Windows_NT" endlocal
766e7c69efSopenharmony_ci
776e7c69efSopenharmony_ci:end
78