diff --git a/extra/shutils/precommit-hook b/extra/shutils/precommit-hook new file mode 100644 index 000000000..4896f531c --- /dev/null +++ b/extra/shutils/precommit-hook @@ -0,0 +1,22 @@ +#!/bin/bash + +SETTINGS="../../lib/core/settings.py" + +declare -x SCRIPTPATH="${0}" + +FULLPATH=${SCRIPTPATH%/*}/$SETTINGS + +if [ -f $FULLPATH ] +then + LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"'); + declare -a LINE; + INCREMENTED=$(python -c "import re, sys; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); _.append(0) if len(_) < 3 else _; _[-1] = str(int(_[-1]) + 1); print sys.argv[1].replace(version, '.'.join(_))" "$LINE") + if [ -n "$INCREMENTED" ] + then + sed "s/${LINE}/${INCREMENTED}/" $FULLPATH > $FULLPATH.tmp && mv $FULLPATH.tmp $FULLPATH + echo "Updated ${INCREMENTED} in ${FULLPATH}"; + else + echo "Something went wrong in VERSION increment" + exit 1 + fi +fi; diff --git a/lib/core/settings.py b/lib/core/settings.py index aa9cd2af7..d44587a22 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,9 +20,10 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version and site -VERSION = "1.0-stable" +VERSION = "1.0.0" REVISION = getRevisionNumber() -VERSION_STRING = "sqlmap/%s" % VERSION +COMMIT_AUTOINCREMENT = 2 +VERSION_STRING = "sqlmap/%s.%d" % (VERSION, COMMIT_AUTOINCREMENT) DESCRIPTION = "automatic SQL injection and database takeover tool" SITE = "http://sqlmap.org" ISSUES_PAGE = "https://github.com/sqlmapproject/sqlmap/issues/new"