mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
gst-indent: Use the same logic to find gnuindent as the git hook
This commit is contained in:
parent
69ea131cfa
commit
35e1103446
1 changed files with 25 additions and 1 deletions
|
@ -1,5 +1,29 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
indent \
|
|
||||||
|
version=`gnuindent --version 2>/dev/null`
|
||||||
|
if test "x$version" = "x"; then
|
||||||
|
version=`indent --version 2>/dev/null`
|
||||||
|
if test "x$version" = "x"; then
|
||||||
|
echo "GStreamer git pre-commit hook:"
|
||||||
|
echo "Did not find GNU indent, please install it before continuing."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
INDENT=indent
|
||||||
|
else
|
||||||
|
INDENT=gnuindent
|
||||||
|
fi
|
||||||
|
|
||||||
|
case `$INDENT --version` in
|
||||||
|
GNU*)
|
||||||
|
;;
|
||||||
|
default)
|
||||||
|
echo "Did not find GNU indent, please install it before continuing."
|
||||||
|
echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$INDENT \
|
||||||
--braces-on-if-line \
|
--braces-on-if-line \
|
||||||
--case-brace-indentation0 \
|
--case-brace-indentation0 \
|
||||||
--case-indentation2 \
|
--case-indentation2 \
|
||||||
|
|
Loading…
Reference in a new issue