buildpacks / docs

Web content for Cloud Native Buildpacks
https://buildpacks.io
Apache License 2.0
30 stars 162 forks source link

Using `echo` instead of `cat` is a bit complicated for beginners #767

Closed linghengqian closed 2 months ago

linghengqian commented 2 months ago

Summary

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

What questions should this documentation answer?

Who is the target audience for this documentation?

Additional Information

linghengqian commented 2 months ago