#
# Configuration check
#
-XMLLINT="$(git config --get hooks.xmllint)"
+XMLINDENT="$(git config --get hooks.xmlindent)"
-if test ! -x "$XMLLINT"
+if test ! -x "$XMLINDENT"
then
- echo "Unable to find xmllint executable on the configuration."
+ echo "Unable to find xmlindent executable on the configuration."
echo
echo "Please configure it with :"
- echo " git config --global hooks.xmllint C:/path/to/xmllint"
+ echo " git config --global hooks.xmlindent C:/path/to/xmlindent"
echo " or "
- echo " git config --global hooks.xmllint /usr/bin/xmllint"
+ echo " git config --global hooks.xmlindent /usr/bin/xmlindent"
echo
fi
-if test -z "$(git config --get-all xmllint.ignored)"
+if test -z "$(git config --get-all xmlindent.ignored)"
then
- echo "Unable to find xmllint ignored list on the configuration, ignored"
+ echo "Unable to find xmlindent ignored list on the configuration, ignored"
echo
echo "You can configure it with :"
- echo " git config --add xmllint.ignored 'scilab/Visual-Studio-settings/*.xml' "
- echo " git config --add xmllint.ignored 'scilab/checkstyle/*.xml' "
+ echo " git config --add xmlindent.ignored 'scilab/Visual-Studio-settings/*.xml' "
+ echo " git config --add xmlindent.ignored 'scilab/checkstyle/*.xml' "
echo
- XMLLINT_IGNORED=""
+ XMLINDENT_IGNORED=""
else
- XMLLINT_IGNORED="$(find $(git config --get-all xmllint.ignored))"
+ XMLINDENT_IGNORED="$(find $(git config --get-all xmlindent.ignored))"
fi
INDENT="$(git config --get hooks.indent)"
esac
done
}
-# Indent the file with xmllint if this is an xcos file
+# Indent the file with xmlindent if this is an xcos file
__indent_Xml() {
- if test ! -x "$XMLLINT"
+ if test ! -x "$XMLINDENT"
then
return;
fi
fi
# ignored globs
- if test -n "$XMLLINT_IGNORED"
+ if test -n "$XMLINDENT_IGNORED"
then
- echo $XMLLINT_IGNORED |grep -q $file
+ echo $XMLINDENT_IGNORED |grep -q $file
if test $? -eq 0
then
echo "Formatting" $file ": ignored"
fi
echo "Formatting" $file
- "$XMLLINT" --format -o "$file" "$file"
+ "$XMLINDENT" -i 2 -o "$file" "$file"
git add "$file"
}
# Indent the file with `indent' if this is a C/CPP file