Branchout / branchout

A manyrepo management tool to allow for local monorepo projecting while keeping everything in distinct repositories
Apache License 2.0
9 stars 2 forks source link

Ensure value #52

Closed stickycode closed 4 years ago

stickycode commented 4 years ago

Add a function to be able to ensure a property is set in the Branchoutfile,

useful for things like BRANCHOUT_GROUP where you want to make sure a value is set before you use it in a script

fixes #25

stickycode commented 4 years ago

It never was good relative because the branchout file is always at the base not in the current directory

Could have detailed in the commit messages

On Thu, 17 Sep 2020, 23:50 Fred Cooke, notifications@github.com wrote:

@fredcooke commented on this pull request.

In branchout https://github.com/Branchout/branchout/pull/52#discussion_r490181454:

  • grep -v "^${1}=" "${BRANCHOUT_FILE}" > "${BRANCHOUT_FILE}".tmp && true
  • echo "${1}=\"${2}\"" >> "${BRANCHOUT_FILE}.tmp"
  • sort "${BRANCHOUT_FILE}.tmp" > "${BRANCHOUT_FILE}"
  • rm "${BRANCHOUT_FILE}.tmp"
  • grep -v "^${1}=" "${BRANCHOUT_DIRECTORY}/${BRANCHOUT_FILE}" > "${BRANCHOUT_DIRECTORY}/${BRANCHOUT_FILE}".tmp && true
  • echo "${1}=\"${2}\"" >> "${BRANCHOUT_DIRECTORY}/${BRANCHOUT_FILE}.tmp"
  • sort "${BRANCHOUT_DIRECTORY}/${BRANCHOUT_FILE}.tmp" > "${BRANCHOUT_DIRECTORY}/${BRANCHOUT_FILE}"
  • rm "${BRANCHOUT_DIRECTORY}/${BRANCHOUT_FILE}.tmp"

I don't see this in the commit comment, at least, not explicitly, why is relative not good enough now?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Branchout/branchout/pull/52#pullrequestreview-490511425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG4GFAUHR6XYYG3LSQ56GLSGHZZNANCNFSM4RQG5WNQ .