Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d76ee8f

Browse files
committed
Further update for #1765
1 parent 5b88e3e commit d76ee8f

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

extra/shutils/postcommit-hook

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
SETTINGS="../../lib/core/settings.py"
4+
5+
declare -x SCRIPTPATH="${0}"
6+
7+
FULLPATH=${SCRIPTPATH%/*}/$SETTINGS
8+
9+
if [ -f $FULLPATH ]
10+
then
11+
LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"');
12+
declare -a LINE;
13+
NEW_TAG=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); print '.'.join(_[:-1]) if len(_) == 4 and _[-1] == '0' else ''" "$LINE")
14+
if [ -n "$NEW_TAG" ]
15+
then
16+
echo "Creating new tag ${NEW_TAG}";
17+
git tag $NEW_TAG;
18+
#git push origin $NEW_TAG
19+
fi
20+
fi;

extra/shutils/precommit-hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [ -f $FULLPATH ]
1010
then
1111
LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"');
1212
declare -a LINE;
13-
INCREMENTED=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); _.append(0) if len(_) < 3 else _; _[-1] = str(int(_[-1]) + 1); month = str(time.gmtime().tm_mon); _[-1] = '1' if _[-2] != month else _[-1]; _[-2] = month; print sys.argv[1].replace(version, '.'.join(_))" "$LINE")
13+
INCREMENTED=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); _.append(0) if len(_) < 3 else _; _[-1] = str(int(_[-1]) + 1); month = str(time.gmtime().tm_mon); _[-1] = '0' if _[-2] != month else _[-1]; _[-2] = month; print sys.argv[1].replace(version, '.'.join(_))" "$LINE")
1414
if [ -n "$INCREMENTED" ]
1515
then
1616
sed "s/${LINE}/${INCREMENTED}/" $FULLPATH > $FULLPATH.tmp && mv $FULLPATH.tmp $FULLPATH

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from lib.core.revision import getRevisionNumber
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.0.3.2"
23+
VERSION = "1.0.3.3"
2424
REVISION = getRevisionNumber()
2525
STABLE = VERSION.count('.') <= 2
2626
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

0 commit comments

Comments
 (0)