# ... if COMMITTAG is not set, use this machine's hostname
COMMITTAG=`hostname -s`
fi
echo
echo Using "'$COMMITTAG'" in the commit messages
echo
ELAPSEDSECS=`date +%s`
echo Using "$ELAPSEDSECS" in the branch names for pseudo-uniqueness
# 2. Check if there are any files that are different from the index
pushd"$COCOS2DX_ROOT"
# Run status to record the output in the log
git status
echo
echo Comparing with HEAD ...
echo
# Don't exit on non-zero return value
set +e
git diff --stat --exit-code
DIFF_RETVAL=$?
if[$DIFF_RETVAL -eq 0]
then
echo
echo"No differences in cocos_files.json"
echo"Exiting with success."
echo
exit0
else
echo
echo"Generated files differ from HEAD. Continuing."
echo
fi
# Exit on error
set -e
popd
COCOS_BRANCH=update_cocosfiles_"$ELAPSEDSECS"
pushd"${DIR}"
# 3. In Cocos2D-X repo, Checkout a branch named "updategeneratedsubmodule" Update the submodule reference to point to the commit with generated bindings