Skip to content

Fixer does not work on macOS #17

@jackbentley

Description

@jackbentley

I know this is intended to be run through docker; however when run on macOS, the fixers don't work due to a missing space in the sed arguments.

It results in the following error:

sed: -e: No such file or directory

The solution is to simply add a space between the -i of the sed command and the blank '' on this line:

MY_FIX_CMD="aci-trailing-newline -1 \"\$1\" || ((echo \"\" >> \"\$1\" && sed -i\"\" -e :a -e \"/^\n*\\\$/{\\\$d;N;ba\" -e \"}\" \"\$1\") && echo \"Fixing: \$1\" || echo \"FAILED: \$1\")"

So it becomes this:

MY_FIX_CMD="aci-trailing-newline -1 \"\$1\" || ((echo \"\" >> \"\$1\" && sed -i \"\" -e :a -e \"/^\n*\\\$/{\\\$d;N;ba\" -e \"}\" \"\$1\") && echo \"Fixing: \$1\" || echo \"FAILED: \$1\")"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions