Skip to content

Commit

Permalink
Simplify documentation for Making your buildpack configurable
Browse files Browse the repository at this point in the history
Signed-off-by: linghengqian <linghengqian@outlook.com>
  • Loading branch information
linghengqian committed Sep 22, 2024
1 parent db64ef4 commit ae2b951
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ if [[ ! -f package.json ]]; then
fi

# ======= ADDED =======
plan=${CNB_BUILD_PLAN_PATH}
version=3.1.3

if [[ -f .node-js-version ]]; then
version=$(cat .node-js-version | tr -d '[:space:]')
version=$(< .node-js-version tr -d '[:space:]')
fi

echo "provides = [{ name = \"node-js\" }]" > "$plan"
echo "requires = [{ name = \"node-js\", metadata = { version = \"$version\" } }]" >> "$plan"
cat > "${CNB_BUILD_PLAN_PATH}" << EOL
provides = [{ name = "node-js" }]
requires = [{ name = "node-js", metadata = { version = "$version" } }]
EOL
# ======= /ADDED =======
```

Expand Down Expand Up @@ -72,7 +73,7 @@ else
fi

# 4. MAKE node-js AVAILABLE DURING LAUNCH and CACHE the LAYER
cat > "${CNB_LAYERS_DIR}/node-js.toml" << EOL
cat > "${CNB_LAYERS_DIR}/node-js.toml" << EOL
[types]
cache = true
launch = true
Expand Down

0 comments on commit ae2b951

Please sign in to comment.