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