代码拉取完成,页面将自动刷新
#!/bin/bash
OPTIONS="--options=conf/astylerc"
RETURN=0
ASTYLE='./astyle'
if [ $? -ne 0 ]; then
echo "[!] astyle not installed. Unable to check source file format policy." >&2
exit 1
fi
FILES=`find . | grep -P "^(.*\/src).*\.(c|cpp|h)$"`
for FILE in $FILES; do
# compare files
# $ASTYLE $OPTIONS < $FILE | cmp -s $FILE -
# if [ $? -ne 0 ]; then
# echo "[!] $FILE does not respect the agreed coding style." >&2
# RETURN=1
# fi
# forcibly format file
$ASTYLE $OPTIONS $FILE
# git add $FILE
echo $FILE
done
if [ $RETURN -eq 1 ]; then
echo "" >&2
echo "Make sure you have run astyle with the following options:" >&2
echo $OPTIONS >&2
fi
exit $RETURN
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。