diff --git a/devTools/scripts/dependencyCheck.bat b/devTools/scripts/dependencyCheck.bat index 7c8743c6b008b5a7c9627408e338fbe4b76563bd..20ee7b66bf158e7d74b3ba4b595acc5867964d41 100644 --- a/devTools/scripts/dependencyCheck.bat +++ b/devTools/scripts/dependencyCheck.bat @@ -28,11 +28,10 @@ IF DEFINED git ( ) :: Otherwise prompt the user -ECHO This project has some optional dependencies that enable features that we believe will make the development process easier and more fruitful. -ECHO You are seeing this because some or all of these dependencies are missing. -ECHO If you wish to no longer see this, please use the simple compiler. 'simple-compiler.bat' +ECHO This project has some optional dependencies that enable extra features that we believe will be helpful to our users and developers. +ECHO You are seeing this because the feature you are trying to use requires dependencies that are missing. ECHO. -ECHO Here is a list of the packages that are missing: +ECHO Here is a list of the dependencies that are missing: IF NOT DEFINED git CALL :gitMessage @@ -74,6 +73,7 @@ GOTO :eof :nodeMessage ECHO Node.js, https://nodejs.org/, enables all of the new sanity checks and the advanced compiler. ECHO Allows for things like: +ECHO Serving FC using 'serve.bat' ECHO Source maps for easier debugging: https://dzone.com/articles/what-are-source-maps-and-how-to-properly-use-them ECHO JavaScript linting to catch bugs early using ESLint: https://eslint.org/ ECHO JavaScript type checking to catch bugs early using the Typescript compiler: https://www.typescriptlang.org/ @@ -90,7 +90,7 @@ GOTO :eof :: if node_modules doesn't exist IF NOT EXIST node_modules ( ECHO. - ECHO All optional dependencies for the advance compiler are installed, but the Node modules are not installed. + ECHO All optional dependencies are installed, but the Node modules are not installed. ECHO. ECHO These packages should take up less than 500MB of disk space. ~150 MB at time of writing. ECHO They will be stored in the 'node_modules' directory inside of the project directory. diff --git a/devTools/scripts/dependencyCheck.sh b/devTools/scripts/dependencyCheck.sh index aa5f5ee0afdd8ded0e3d94797450e034249d15c8..beee2e91e08cee8c6c574ba9753a85f2acfcb46d 100755 --- a/devTools/scripts/dependencyCheck.sh +++ b/devTools/scripts/dependencyCheck.sh @@ -17,7 +17,7 @@ function modulesCheck() { if [[ ! -d node_modules ]]; then # ask user if we can install modules echo "" - echo "All optional dependencies for the advance compiler are installed, but the Node modules are not installed." + echo "All optional dependencies are installed, but the Node modules are not installed." echo "" echo "These packages should take up less than 500MB of disk space. (~150 MB at time of writing)." echo "They will be stored in the 'node_modules' directory inside of the project directory." @@ -141,11 +141,10 @@ if [[ "$git" && "$node" ]]; then fi # Otherwise prompt the user -echo "This project has some optional dependencies that enable features that we believe will make the development process easier and more fruitful." -echo "You are seeing this because some or all of these dependencies are missing." -echo "If you wish to no longer see this, please use the simple compiler. 'simple-compiler.sh'" +echo "This project has some optional dependencies that enable extra features that we believe will be helpful to our users and developers." +echo "You are seeing this because the feature you are trying to use requires dependencies that are missing." echo "" -echo "Here is a list of the packages that are missing:" +echo "Here is a list of the dependencies that are missing:" if [[ ! "$git" ]]; then echo " git, https://git-scm.com/, needed to interact with the .git folder in this project." @@ -157,6 +156,7 @@ fi if [[ ! "$node" ]]; then echo " Node.js, https://nodejs.org/, enables all of the new sanity checks and the advanced compiler." echo " Allows for things like:" + echo " Serving FC using 'serve.sh'" echo " Source maps for easier debugging: https://dzone.com/articles/what-are-source-maps-and-how-to-properly-use-them" echo " JavaScript linting to catch bugs early using ESLint: https://eslint.org/" echo " JavaScript type checking to catch bugs early using the Typescript compiler: https://www.typescriptlang.org/" diff --git a/serve.bat b/serve.bat index 986de8a1fe9163067e13568d8f4eaface51001a9..55e5128ce415b6338645348982ece2de3a908255 100644 --- a/serve.bat +++ b/serve.bat @@ -5,24 +5,25 @@ pushd %~dp0 SET BASEDIR=%~dp0 -:: check for node -where /q node -IF ERRORLEVEL 1 ( - ECHO Node is required to run this http server. - exit /b 0 -) +:: run dependencyCheck.bat +CALL .\devTools\scripts\dependencyCheck.bat +SET CODE=%ERRORLEVEL% -:: if the node_modules directory doesn't exist -IF NOT EXIST .\node_modules\ ( - ECHO Node available, but the required Node modules are not installed. - CHOICE /C YN /N /M "Would you like us to run 'npm install' to install Node modules, using ~120 MB of disk space [Y/N]?" - IF !errorlevel!==1 ( - ECHO Installing Node modules... - CALL npm install - ) ELSE ( - ECHO Requirements not met, exiting... - exit /b 0 - ) +IF %CODE% EQU 69 ( + :: if exit code is 69, then we don't have all the dependencies we need + ECHO. + ECHO Dependencies not met. + ECHO. + EXIT /b 0 +) ELSE IF %CODE% EQU 0 ( + :: if exit code is 0, run web server + CALL npx http-server --port 6969 -c-1 + EXIT /b 0 +) ELSE ( + :: if exit code is not 0, print error message + ECHO. + ECHO dependencyCheck.bat exited with code: %CODE% + ECHO Dependency check failed. + ECHO. + EXIT /b 0 ) - -CALL npx http-server --port 6969 -c-1 diff --git a/serve.sh b/serve.sh index bf0b76429b9cdc0fe4e8a84db98ce28cb0a9d7a3..df006ed86026f2577c9a48c03930d6ee8ba45d2e 100755 --- a/serve.sh +++ b/serve.sh @@ -15,7 +15,7 @@ if [[ $exitCode -eq 69 ]]; then # if exit code is not 0, print error message elif [[ $exitCode -ne 0 ]]; then echo "dependencyCheck.sh exited with code: $exitCode" - echo "Dependency check failed unexpectedly." + echo "Dependency check failed." echo "" exit 0 # if exit code is 0, run web server diff --git a/setup.bat b/setup.bat index 62601e4445126349f66060bc61c73245b8d291c8..e5954b4561b224c3ccc7230890ff1da01a0c8203 100644 --- a/setup.bat +++ b/setup.bat @@ -20,7 +20,7 @@ IF %CODE% EQU 69 ( :: if exit code is not 0, print error message ECHO. ECHO dependencyCheck.bat exited with code: %CODE% - ECHO Dependency check failed unexpectedly. + ECHO Dependency check failed. ECHO If the only thing you need is to simply compile FC, then you can use 'simple-compiler.bat' instead. ECHO. EXIT /b 0 diff --git a/setup.sh b/setup.sh index 8910112836ee3a7ee79659e5a037e5eebc6cb39c..cc7fc64cfebd56290bcc9bc471a089f0f17e92f9 100755 --- a/setup.sh +++ b/setup.sh @@ -16,7 +16,7 @@ if [[ $exitCode -eq 69 ]]; then # if exit code is not 0, print error message elif [[ $exitCode -ne 0 ]]; then echo "dependencyCheck.sh exited with code: $exitCode" - echo "Dependency check failed unexpectedly." + echo "Dependency check failed." echo "If the only thing you need is to simply compile FC, then you can use 'simple-compiler.bat' instead." echo "" exit 0