Skip to content

Commit

Permalink
Don't change the next.js version by default. (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
telackey authored Nov 13, 2023
1 parent 0aca087 commit f1f618c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM cerc/nextjs-base:local

ARG CERC_NEXT_VERSION=latest
ARG CERC_NEXT_VERSION=keep
ARG CERC_BUILD_TOOL

WORKDIR /app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi

CERC_NEXT_VERSION="${CERC_NEXT_VERSION:-^14.0.2}"
CERC_NEXT_VERSION="${CERC_NEXT_VERSION:-keep}"
CERC_BUILD_TOOL="${CERC_BUILD_TOOL}"
if [ -z "$CERC_BUILD_TOOL" ]; then
if [ -f "yarn.lock" ] && [ ! -f "package-lock.json" ]; then
Expand Down Expand Up @@ -101,8 +101,10 @@ cat package.dist | jq '.scripts.cerc_compile = "next experimental-compile"' | jq
CUR_NEXT_VERSION="`jq -r '.dependencies.next' package.json`"

if [ "$CERC_NEXT_VERSION" != "keep" ] && [ "$CUR_NEXT_VERSION" != "$CERC_NEXT_VERSION" ]; then
echo "Changing 'next' version from $CUR_NEXT_VERSION to $CERC_NEXT_VERSION (set with --build-arg CERC_NEXT_VERSION)"
echo "Changing 'next' version specifier from '$CUR_NEXT_VERSION' to '$CERC_NEXT_VERSION' (set with --build-arg CERC_NEXT_VERSION)"
cat package.json | jq ".dependencies.next = \"$CERC_NEXT_VERSION\"" | sponge package.json
else
echo "'next' version specifier '$CUR_NEXT_VERSION' (override with --build-arg CERC_NEXT_VERSION)"
fi

$CERC_BUILD_TOOL install || exit 1
Expand Down

0 comments on commit f1f618c

Please sign in to comment.