SMQ-2832: Fix make sed -i compatible with both macOS and Linux #2833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wheresed -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
README.md
orCONTRIBUTING.md
to remind contributors aboutsed
portability could help avoid this in future.