Skip to content

SMQ-2832: Fix make sed -i compatible with both macOS and Linux #2833

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nintran52
Copy link

What type of PR is this?

This is a bug fix because it fixes the following issue: sed -i syntax incompatibility between macOS and Linux in vault environment variable setup script.

What does this do?

This PR fixes a cross-platform compatibility issue in the vault_copy_env.sh script where sed -i fails on macOS due to BSD sed syntax. The script now detects the OS and applies the correct -i option:

  • sed -i '' for macOS (BSD sed)
  • sed -i for Linux (GNU sed)

No functionality is broken or changed — the behavior is preserved but made portable across systems.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

No, I have not included tests because this is a shell script fix targeting developer tooling, which is hard to unit test. However, I manually tested on both macOS and Linux to ensure compatibility.

Did you document any new/modified feature?

No new features. Behavior remains the same. The logic is now more robust across environments.

Notes

  • This fix is important for contributors and CI/CD systems that use macOS or Linux interchangeably.
  • A follow-up update in README.md or CONTRIBUTING.md to remind contributors about sed portability could help avoid this in future.

Signed-off-by: Nin Tran <nin.tran52@gmail.com>
@nintran52 nintran52 requested a review from a team as a code owner April 22, 2025 03:51
@nintran52
Copy link
Author

@dborovcanin could you take a look

@nintran52 nintran52 requested a review from dborovcanin April 25, 2025 08:52
@nintran52
Copy link
Author

I fixed the comment, @dborovcanin pls help me to check

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.

2 participants