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@echo off 14@if "%DEBUG%" == "" @echo off 15@rem ########################################################################## 16@rem 17@rem Hvigor startup script for Windows 18@rem 19@rem ########################################################################## 20 21@rem Set local scope for the variables with windows NT shell 22if "%OS%"=="Windows_NT" setlocal 23 24set DIRNAME=%~dp0 25if "%DIRNAME%" == "" set DIRNAME=. 26set APP_BASE_NAME=%~n0 27set APP_HOME=%DIRNAME% 28 29@rem Resolve any "." and ".." in APP_HOME to make it shorter. 30for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 31 32set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js 33set NODE_EXE=node.exe 34 35goto start 36 37:start 38@rem Find node.exe 39if defined NODE_HOME goto findNodeFromNodeHome 40 41%NODE_EXE% --version >NUL 2>&1 42if "%ERRORLEVEL%" == "0" goto execute 43 44echo. 45echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. 46echo. 47echo Please set the NODE_HOME variable in your environment to match the 48echo location of your NodeJs installation. 49 50goto fail 51 52:findNodeFromNodeHome 53set NODE_HOME=%NODE_HOME:"=% 54set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% 55 56if exist "%NODE_EXE_PATH%" goto execute 57echo. 58echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. 59echo. 60echo Please set the NODE_HOME variable in your environment to match the 61echo location of your NodeJs installation. 62 63goto fail 64 65:execute 66@rem Execute hvigor 67"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* 68 69if "%ERRORLEVEL%" == "0" goto hvigorwEnd 70 71:fail 72exit /b 1 73 74:hvigorwEnd 75if "%OS%" == "Windows_NT" endlocal 76 77:end 78