aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2024-04-01 14:42:14 +0000
committerLibravatar GitHub <noreply@github.com>2024-04-01 14:42:14 +0000
commit484bcd8928dde915e1e0b4432fcd0f25cd6b2bc5 (patch)
treee34510ae2e399e8dcc54487876612b98a08d9bf7 /scripts
parentupgrade node to 20.11.1 and other minor versions for pkgs (#104) (diff)
downloadferdium-server-484bcd8928dde915e1e0b4432fcd0f25cd6b2bc5.tar.gz
ferdium-server-484bcd8928dde915e1e0b4432fcd0f25cd6b2bc5.tar.zst
ferdium-server-484bcd8928dde915e1e0b4432fcd0f25cd6b2bc5.zip
Update dev scripts (#126)
* Upgrade pnpm to 8.15.5 * Upgrade node to latest LTS (20.12.0) and some other modules
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-unix.sh14
-rw-r--r--scripts/build-windows.ps18
2 files changed, 17 insertions, 5 deletions
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
68 68
69# ----------------------------------------------------------------------------- 69# -----------------------------------------------------------------------------
70# Ensure that the system dependencies are at the correct version - fail if not 70# Ensure that the system dependencies are at the correct version - fail if not
71# Check node version
72EXPECTED_NODE_VERSION=$(cat .nvmrc)
73ACTUAL_NODE_VERSION=$(node -v)
74if [ "v$EXPECTED_NODE_VERSION" != "$ACTUAL_NODE_VERSION" ]; then
75 fail_with_docs "You are not running the expected version of node!
76 expected: [v$EXPECTED_NODE_VERSION]
77 actual : [$ACTUAL_NODE_VERSION]"
78fi
79
71# Check python version 80# Check python version
72EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python') 81EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python')
73ACTUAL_PYTHON_VERSION=$(python --version | sed -e "s/Python //") 82ACTUAL_PYTHON_VERSION=$(python --version | sed -e "s/Python //")
@@ -79,8 +88,6 @@ fi
79 88
80# ----------------------------------------------------------------------------- 89# -----------------------------------------------------------------------------
81# Ensure that the system dependencies are at the correct version - recover if not 90# Ensure that the system dependencies are at the correct version - recover if not
82# If 'asdf' is installed, reshim for new nodejs if necessary
83command_exists asdf && asdf reshim nodejs
84 91
85# Check pnpm version 92# Check pnpm version
86EXPECTED_PNPM_VERSION=$(node -p 'require("./recipes/package.json").engines.pnpm') 93EXPECTED_PNPM_VERSION=$(node -p 'require("./recipes/package.json").engines.pnpm')
@@ -89,9 +96,6 @@ if [[ "$ACTUAL_PNPM_VERSION" != "$EXPECTED_PNPM_VERSION" ]]; then
89 npm i -gf pnpm@$EXPECTED_PNPM_VERSION 96 npm i -gf pnpm@$EXPECTED_PNPM_VERSION
90fi 97fi
91 98
92# If 'asdf' is installed, reshim for new nodejs if necessary
93command_exists asdf && asdf reshim nodejs
94
95ENV_FILE=".env" 99ENV_FILE=".env"
96if [[ ! -s $ENV_FILE ]]; then 100if [[ ! -s $ENV_FILE ]]; then
97 APP_KEY=`cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w ${1:-32} | head -n 1` 101 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")
92 92
93# ----------------------------------------------------------------------------- 93# -----------------------------------------------------------------------------
94# Ensure that the system dependencies are at the correct version - fail if not 94# Ensure that the system dependencies are at the correct version - fail if not
95# Check node version
96EXPECTED_NODE_VERSION=(Get-Content .nvmrc)
97ACTUAL_NODE_VERSION=(node -v)
98if ([System.Version]$ACTUAL_NODE_VERSION -ne [System.Version]$EXPECTED_NODE_VERSION) {
99 fail_with_docs "You are not running the expected version of node!
100 expected: [v$EXPECTED_NODE_VERSION]
101 actual : [$ACTUAL_NODE_VERSION]"
102}
95# Check python version 103# Check python version
96$EXPECTED_PYTHON_VERSION = (Get-Content package.json | ConvertFrom-Json).engines.python 104$EXPECTED_PYTHON_VERSION = (Get-Content package.json | ConvertFrom-Json).engines.python
97$ACTUAL_PYTHON_VERSION = (python --version).trim("Python ") 105$ACTUAL_PYTHON_VERSION = (python --version).trim("Python ")