Skip to content

Commit

Permalink
STYLE.md: Add command to append nl to EOF
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
  • Loading branch information
1480c1 committed Aug 6, 2019
1 parent fcf4457 commit b0166f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ sed -i 's/\t/ /g;s/[[:space:]]*$//g' <Filename/Filepath>

Note: For macOS and BSD related distros, you may need to use `sed -i ''` inplace due to differences with GNU sed.

``` bash
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
```

Use this to auto append a newline to the end of the file for any files that are under git.
Taken from [here](https://unix.stackexchange.com/a/161853)

### For Powershell/pwsh

``` Powershell
Expand Down

0 comments on commit b0166f9

Please sign in to comment.