1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-12-02 08:09:36 +00:00
MarlinFirmware/buildroot/bin/uncrust
Scott Lahteine 528a1ad3e0 🧑‍💻 Move Uncrustify config
2024-08-29 21:38:57 -05:00

19 lines
469 B
Bash
Executable File

#!/usr/bin/env bash
#
# Run uncrustify for a file in-place
#
TMPDIR=`mktemp -d`
HERE=`dirname "$0"`
# Reformat a single file to tmp/
if uncrustify -l CPP -c "$HERE/../share/uncrustify/uncrustify.cfg" -f "$1" >$TMPDIR/uncrustify.out ; then
cp "$TMPDIR/uncrustify.out" "$1" ; # Replace the original file
else
echo "Something went wrong with uncrustify."
fi
# Clean up, deliberately
[[ -f "$TMPDIR/uncrustify.out" ]] && rm "$TMPDIR/uncrustify.out"
rmdir "$TMPDIR"