diff options
Diffstat (limited to 'scripts/build-unix.sh')
-rwxr-xr-x | scripts/build-unix.sh | 14 |
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 | ||
72 | EXPECTED_NODE_VERSION=$(cat .nvmrc) | ||
73 | ACTUAL_NODE_VERSION=$(node -v) | ||
74 | if [ "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]" | ||
78 | fi | ||
79 | |||
71 | # Check python version | 80 | # Check python version |
72 | EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python') | 81 | EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python') |
73 | ACTUAL_PYTHON_VERSION=$(python --version | sed -e "s/Python //") | 82 | ACTUAL_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 | ||
83 | command_exists asdf && asdf reshim nodejs | ||
84 | 91 | ||
85 | # Check pnpm version | 92 | # Check pnpm version |
86 | EXPECTED_PNPM_VERSION=$(node -p 'require("./recipes/package.json").engines.pnpm') | 93 | EXPECTED_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 |
90 | fi | 97 | fi |
91 | 98 | ||
92 | # If 'asdf' is installed, reshim for new nodejs if necessary | ||
93 | command_exists asdf && asdf reshim nodejs | ||
94 | |||
95 | ENV_FILE=".env" | 99 | ENV_FILE=".env" |
96 | if [[ ! -s $ENV_FILE ]]; then | 100 | if [[ ! -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` |