if [[ -f .node-js-version ]]; then
version=$(cat .node-js-version | tr -d '[:space:]')
fi
echo "provides = [{ name = \"node-js\" }]" > "$plan"
echo "requires = [{ name = \"node-js\", metadata = { version = \"$version\" } }]" >> "$plan"
- It should be changed to,
```shell
version=3.1.3
if [[ -f .node-js-version ]]; then
version=$(< .node-js-version tr -d '[:space:]')
fi
cat > "${CNB_BUILD_PLAN_PATH}" << EOL
provides = [{ name = "node-js" }]
requires = [{ name = "node-js", metadata = { version = "$version" } }]
EOL
This will avoid IntelliJ IDEA warnings.
What questions should this documentation answer?
Null.
Who is the target audience for this documentation?
Summary
echo
instead ofcat
is a bit complicated for beginners. See https://buildpacks.io/docs/for-buildpack-authors/tutorials/basic-buildpack/07_make-buildpack-configurable/ .if [[ -f .node-js-version ]]; then version=$(cat .node-js-version | tr -d '[:space:]') fi
echo "provides = [{ name = \"node-js\" }]" > "$plan" echo "requires = [{ name = \"node-js\", metadata = { version = \"$version\" } }]" >> "$plan"
What questions should this documentation answer?
Who is the target audience for this documentation?
Additional Information