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

Replaced broken sed command (on macs) with ed alternative. #836

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

plascaray
Copy link
Contributor

@plascaray plascaray commented Sep 6, 2024

Fixes #790

Fixed the broken sed command with an ed alternative. Spent some time trying to get an alternative sed command to work but I was not able to find one.

The new ed command finds the CONNECT_VERSION line, moves to the next line and changes the whole line with the new content, then stops processing changes, saves and quits.

I noticed that all blocks for each product use the same pattern, I can update the rest when the changes are reviewed / approved.

I also noticed that this notation seems to break syntax highlighting on VSCode. I have an alternative awk implementation that does not have that issue (it requires a file swap so I favored ed since it does the change in place):

  awk -v new_version="{{ RSC_VERSION }}" '
  /variable CONNECT_VERSION/ { print; getline; print "    default = \"" new_version "\""; next }
  { print }
  ' docker-bake.hcl > file.tmp && mv file.tmp docker-bake.hcl

Copy link
Contributor

@bschwedler bschwedler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for tackling this!

I wouldn't worry about syntax highlighting breaking in VS Code. That seems to happen any time I have to do anything somewhat complex in a justfile.

As long as the ed or awk command works on both Mac and Linux, I am happy with using either solution for all of the updates.

If you could please implement this for the other update-version commands, that would be most excellent!
Thanks!

@plascaray plascaray merged commit 2066dab into dev Sep 23, 2024
37 checks passed
@plascaray plascaray deleted the pbl-fix-connect-builds branch September 23, 2024 15:18
@dbkegley
Copy link
Contributor

@bschwedler since Connect is planning a release for later this week, would it be possible to get these changes merged into main as well?

@bschwedler
Copy link
Contributor

Most definitely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating RSC_VERSION fails on MacOS
3 participants