hvigorw.bat 1.5 KB

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