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