Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 4 tasks
linghengqian opened this issue Sep 22, 2024 · 1 comment · Fixed by #768
Closed
1 of 4 tasks

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

linghengqian opened this issue Sep 22, 2024 · 1 comment · Fixed by #768
Labels
type/enhancement Issue that requests a new feature or improvement.

Comments

@linghengqian
Copy link
Contributor

linghengqian commented Sep 22, 2024

Summary

plan=${CNB_BUILD_PLAN_PATH}
version=3.1.3

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,
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.
  • image

What questions should this documentation answer?

  • Null.

Who is the target audience for this documentation?

  • App Developer
  • Buildpack Author
  • Operator
  • Other:

Additional Information

@linghengqian linghengqian added the type/enhancement Issue that requests a new feature or improvement. label Sep 22, 2024
@linghengqian
Copy link
Contributor Author

  • I will submit a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant