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