Skip to content

sed command fails on macOS due to BSD/GNU syntax differences #2

@sudoytang

Description

@sudoytang

Hello,

I encountered an issue when running the plugin on macOS.
The setup process fails during the string replacement step because of how sed is invoked.

Image

The current implementation uses sed -i without an extension argument, which works perfectly on Linux (GNU sed) but fails on macOS (BSD sed). BSD sed needs an extension argument after -i, or it will intepret the substitution string as the extension and the filename as the command, causing an error.

If it is possible I would like to submit a PR to fix this.
I propose to replace sed with perl -pi -e, this command does exactly what sed does but its behavior is consistent across OS.
Or if we are going to continue using sed, we may use sed -i.bak and then add a subsequent command to remove the generated .bak files.

Please let me know your preference and I will open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions