• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1:: Copyright (c) 2023 Huawei Device Co., Ltd.
2:: Licensed under the Apache License, Version 2.0 (the "License");
3:: you may not use this file except in compliance with the License.
4:: You may obtain a copy of the License at
5::
6::  http://www.apache.org/licenses/LICENSE-2.0
7::
8:: Unless required by applicable law or agreed to in writing, software
9:: distributed under the License is distributed on an "AS IS" BASIS,
10:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11:: See the License for the specific language governing permissions and
12:: limitations under the License.
13
14@echo off
15
16
17@if "%DEBUG%" == "" @echo off
18@rem ##########################################################################
19@rem
20@rem  Hvigor startup script for Windows
21@rem
22@rem ##########################################################################
23
24@rem Set local scope for the variables with windows NT shell
25if "%OS%"=="Windows_NT" setlocal
26
27set DIRNAME=%~dp0
28if "%DIRNAME%" == "" set DIRNAME=.
29set APP_BASE_NAME=%~n0
30set APP_HOME=%DIRNAME%
31
32@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34
35set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
36set NODE_EXE=node.exe
37
38goto start
39
40:start
41@rem Find node.exe
42if defined NODE_HOME goto findNodeFromNodeHome
43
44%NODE_EXE% --version >NUL 2>&1
45if "%ERRORLEVEL%" == "0" goto execute
46
47echo.
48echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
49echo.
50echo Please set the NODE_HOME variable in your environment to match the
51echo location of your NodeJs installation.
52
53goto fail
54
55:findNodeFromNodeHome
56set NODE_HOME=%NODE_HOME:"=%
57set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
58
59if exist "%NODE_EXE_PATH%" goto execute
60echo.
61echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
62echo.
63echo Please set the NODE_HOME variable in your environment to match the
64echo location of your NodeJs installation.
65
66goto fail
67
68:execute
69@rem Execute hvigor
70"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
71
72:fail
73exit /b 1
74