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@echo off
156e7c69efSopenharmony_ci@if "%DEBUG%" == "" @echo off
166e7c69efSopenharmony_ci@rem ##########################################################################
176e7c69efSopenharmony_ci@rem
186e7c69efSopenharmony_ci@rem  Hvigor startup script for Windows
196e7c69efSopenharmony_ci@rem
206e7c69efSopenharmony_ci@rem ##########################################################################
216e7c69efSopenharmony_ci
226e7c69efSopenharmony_ci@rem Set local scope for the variables with windows NT shell
236e7c69efSopenharmony_ciif "%OS%"=="Windows_NT" setlocal
246e7c69efSopenharmony_ci
256e7c69efSopenharmony_ciset DIRNAME=%~dp0
266e7c69efSopenharmony_ciif "%DIRNAME%" == "" set DIRNAME=.
276e7c69efSopenharmony_ciset APP_BASE_NAME=%~n0
286e7c69efSopenharmony_ciset APP_HOME=%DIRNAME%
296e7c69efSopenharmony_ci
306e7c69efSopenharmony_ci@rem Resolve any "." and ".." in APP_HOME to make it shorter.
316e7c69efSopenharmony_cifor %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
326e7c69efSopenharmony_ci
336e7c69efSopenharmony_ciset WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
346e7c69efSopenharmony_ciset NODE_EXE=node.exe
356e7c69efSopenharmony_ci
366e7c69efSopenharmony_cigoto start
376e7c69efSopenharmony_ci
386e7c69efSopenharmony_ci:start
396e7c69efSopenharmony_ci@rem Find node.exe
406e7c69efSopenharmony_ciif defined NODE_HOME goto findNodeFromNodeHome
416e7c69efSopenharmony_ci
426e7c69efSopenharmony_ci%NODE_EXE% --version >NUL 2>&1
436e7c69efSopenharmony_ciif "%ERRORLEVEL%" == "0" goto execute
446e7c69efSopenharmony_ci
456e7c69efSopenharmony_ciecho.
466e7c69efSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
476e7c69efSopenharmony_ciecho.
486e7c69efSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
496e7c69efSopenharmony_ciecho location of your NodeJs installation.
506e7c69efSopenharmony_ci
516e7c69efSopenharmony_cigoto fail
526e7c69efSopenharmony_ci
536e7c69efSopenharmony_ci:findNodeFromNodeHome
546e7c69efSopenharmony_ciset NODE_HOME=%NODE_HOME:"=%
556e7c69efSopenharmony_ciset NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
566e7c69efSopenharmony_ci
576e7c69efSopenharmony_ciif exist "%NODE_EXE_PATH%" goto execute
586e7c69efSopenharmony_ciecho.
596e7c69efSopenharmony_ciecho ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
606e7c69efSopenharmony_ciecho.
616e7c69efSopenharmony_ciecho Please set the NODE_HOME variable in your environment to match the
626e7c69efSopenharmony_ciecho location of your NodeJs installation.
636e7c69efSopenharmony_ci
646e7c69efSopenharmony_cigoto fail
656e7c69efSopenharmony_ci
666e7c69efSopenharmony_ci:execute
676e7c69efSopenharmony_ci@rem Execute hvigor
686e7c69efSopenharmony_ci"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
696e7c69efSopenharmony_ci
706e7c69efSopenharmony_ci:fail
716e7c69efSopenharmony_ciexit /b 1
72