Skip to content

Instantly share code, notes, and snippets.

@hauleth hauleth/fix-fmt.sh
Last active Nov 10, 2017

Embed
What would you like to do?
#!/bin/sh
set -eo pipefail
in="$(mktemp)"
out="$(mktemp)"
trap "rm '$in' '$out'" EXIT
cat /dev/stdin > "$in"
"$@" < "$in" 2>/dev/null > "$out" && cat "$out" || cat "$in"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.