Skip to content

fix sed handling in macOS #7

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

Merged
merged 6 commits into from
Oct 21, 2024
Merged

fix sed handling in macOS #7

merged 6 commits into from
Oct 21, 2024

Conversation

mcnaveen
Copy link
Contributor

@mcnaveen mcnaveen commented Oct 21, 2024

Why this PR?

This PR does two different things.

  • Moves the write_secrets function outside of generate_secrets to avoid nested functions.
  • Handling of sed across Unix/Linux operating systems.

Desc

sed behaves differently on GNU and macOS.

The —i '' syntax correctly tells macOS's sed not to create a backup, which is the required form. The script also uses | as a delimiter for the sed substitution, which can sometimes make the script more readable and avoid conflicts with / characters in paths or values.

Test

Tested on macos sequoia 15.0.1 (24A348) & Linux Ubuntu 6.8.0-45-generic (Ubuntu 22.04)

Resolves #6

@mcnaveen mcnaveen changed the title fix(lib): 🐛 fix sed handling in macOS fix(lib): 🐛 sed handling in macOS Oct 21, 2024
@nicktrn nicktrn changed the title fix(lib): 🐛 sed handling in macOS fix sed handling in macOS Oct 21, 2024
Copy link
Collaborator

@nicktrn nicktrn left a comment

Choose a reason for hiding this comment

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

Thanks! 🙏

@nicktrn nicktrn merged commit 1b554af into triggerdotdev:main Oct 21, 2024
@mcnaveen
Copy link
Contributor Author

mcnaveen commented Oct 21, 2024

Okay! ✨

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.

sed: 1: "./.env": invalid command code .
2 participants