From 484bcd8928dde915e1e0b4432fcd0f25cd6b2bc5 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Mon, 1 Apr 2024 14:42:14 +0000 Subject: Update dev scripts (#126) * Upgrade pnpm to 8.15.5 * Upgrade node to latest LTS (20.12.0) and some other modules --- scripts/build-unix.sh | 14 +++++++++----- scripts/build-windows.ps1 | 8 ++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/build-unix.sh b/scripts/build-unix.sh index f9e020d..dc0871d 100755 --- a/scripts/build-unix.sh +++ b/scripts/build-unix.sh @@ -68,6 +68,15 @@ fi # ----------------------------------------------------------------------------- # Ensure that the system dependencies are at the correct version - fail if not +# Check node version +EXPECTED_NODE_VERSION=$(cat .nvmrc) +ACTUAL_NODE_VERSION=$(node -v) +if [ "v$EXPECTED_NODE_VERSION" != "$ACTUAL_NODE_VERSION" ]; then + fail_with_docs "You are not running the expected version of node! + expected: [v$EXPECTED_NODE_VERSION] + actual : [$ACTUAL_NODE_VERSION]" +fi + # Check python version EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python') ACTUAL_PYTHON_VERSION=$(python --version | sed -e "s/Python //") @@ -79,8 +88,6 @@ fi # ----------------------------------------------------------------------------- # Ensure that the system dependencies are at the correct version - recover if not -# If 'asdf' is installed, reshim for new nodejs if necessary -command_exists asdf && asdf reshim nodejs # Check pnpm version EXPECTED_PNPM_VERSION=$(node -p 'require("./recipes/package.json").engines.pnpm') @@ -89,9 +96,6 @@ if [[ "$ACTUAL_PNPM_VERSION" != "$EXPECTED_PNPM_VERSION" ]]; then npm i -gf pnpm@$EXPECTED_PNPM_VERSION fi -# If 'asdf' is installed, reshim for new nodejs if necessary -command_exists asdf && asdf reshim nodejs - ENV_FILE=".env" if [[ ! -s $ENV_FILE ]]; then APP_KEY=`cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w ${1:-32} | head -n 1` diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1 index c22e033..1bed200 100644 --- a/scripts/build-windows.ps1 +++ b/scripts/build-windows.ps1 @@ -92,6 +92,14 @@ if ($env:CLEAN -eq "true") # ----------------------------------------------------------------------------- # Ensure that the system dependencies are at the correct version - fail if not +# Check node version +EXPECTED_NODE_VERSION=(Get-Content .nvmrc) +ACTUAL_NODE_VERSION=(node -v) +if ([System.Version]$ACTUAL_NODE_VERSION -ne [System.Version]$EXPECTED_NODE_VERSION) { + fail_with_docs "You are not running the expected version of node! + expected: [v$EXPECTED_NODE_VERSION] + actual : [$ACTUAL_NODE_VERSION]" +} # Check python version $EXPECTED_PYTHON_VERSION = (Get-Content package.json | ConvertFrom-Json).engines.python $ACTUAL_PYTHON_VERSION = (python --version).trim("Python ") -- cgit v1.2.3-54-g00ecf