$ASTYLE -a -f -p -o -O -c -s2 -U -x --mode=c < $file > $newfile 2>>/dev/null
diff "${file}" "${newfile}"
r=$?
- rm "${newfile}"
if [ $r != 0 ] ; then
echo "Code style error in '$file', please fix before commiting."
- echo "To autofix, create a hidden file named './.fix_style' on suite root."
-pwd
-echo xxxx
- exit 1
+ if [ -f "./.fix_style" ]; then
+ echo "Auto-fixing code style..."
+ mv $newfile $file
+ else
+ echo "To autofix, create a hidden file named './.fix_style' on suite root."
+ rm $newfile
+ exit 1
+ fi
+ else
+ rm $newfile
fi
}
std::map<std::string, std::string>::const_iterator it = a_managedVars.find(variableName);
- if (it == a_managedVars.end()) {
+ if(it == a_managedVars.end()) {
std::string msg = "The variable '";
msg += variableName;
msg += "' is not defined in the environment.";