aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-unix.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-unix.sh')
-rwxr-xr-xscripts/build-unix.sh14
1 files changed, 9 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`