build script: Check for minimum version of npm

This commit is contained in:
Starbeamrainbowlabs 2019-02-20 17:19:53 +00:00
parent 3c2605dcb9
commit a3cd55966a
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 11 additions and 0 deletions

11
build
View File

@ -16,11 +16,17 @@ lantern_path="./lantern-build-engine";
###
# Put any custom settings here.
# Client-side build output
build_output_folder="./app";
# Database settings for ssh port forwarding task
database_host="db.connectedhumber.org";
database_name="aq_db";
# Minimum major version of npm
min_npm_version_major="6";
###############################################################################
# Check out the lantern git submodule if needed
@ -60,6 +66,11 @@ function task_setup {
check_command node true;
check_command composer true;
check_command npm true;
npm_version_major="$(npm --version | head -c 1)";
if [[ "${npm_version_major}" -lt "${min_npm_version_major}" ]]; then
echo "${FRED}${HC}Error: Your version of npm is too far out of date. You're running version $(npm --version), but version 6+ is required.";
fi
task_end $?;
task_begin "Initialising submodules";