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

feat: make sed and find commands portable between Linux (GNU) and Mac OS (BSD) #1043

Conversation

romanini-ciandt
Copy link
Contributor

@romanini-ciandt romanini-ciandt commented Nov 30, 2023

Issues #984, #922

The goal of this PR is to make all the sed and find commands portable between Linux (GNU) and Mac OS (BSD). Nowadays, Mac OS users have some issues with some params (more details at the linked issues).

  • For find: the issue is that GNU by default assumes that we want to run in the current path (or .), while in BSD we need to explicit pass the path (.) as input.

  • For sed -i: sed file in-place suggests a need for a backup file. In GNU, if the backup file is not explict provided, the original file is overwritten but for GNU the way to achieve this same behavior (no backup saved) is to provide a zero-length extension as parameter.

References:

@romanini-ciandt romanini-ciandt self-assigned this Nov 30, 2023
This was linked to issues Nov 30, 2023
Copy link

@lanre-OG lanre-OG left a comment

Choose a reason for hiding this comment

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

LGTM

@Samir-Cit
Copy link
Contributor

@gtsorbo @apeabody build is green :)

@daniel-cit
Copy link
Contributor

@apeabody @gtsorbo Build is 🟢

@apeabody apeabody merged commit 62e8c23 into terraform-google-modules:master Dec 15, 2023
6 checks passed
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.

0-org Errors in step 10 on Mac sed on mac requires backup file
6 participants