Skip to content

Instantly share code, notes, and snippets.

View flying-sausages's full-sized avatar
🕴️
🌭

flying-sausages

🕴️
🌭
View GitHub Profile
@flying-sausages
flying-sausages / README.md
Last active May 29, 2021 12:18
Automatically apply shellcheck diff recursively

Automatically apply shellcheck diff recursively

That's right!

Why?

  1. Shellcheck can generate a diff of the changes it would auto-fix, but there's no flag to just apply them
  2. patch can be a bit annoying recursively
  3. A normal bash forloop over files only of specific names is a bit annoying

And this does?

Finds all files that end with .sh inside of the current directory, generates the diff for it, and immediately patches it