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

Skip to content

Commit 73f1155

Browse files
committed
Adding new shutils file
1 parent fcf9998 commit 73f1155

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

extra/shutils/precommit-hook

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
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")
14+
if [ -n "$INCREMENTED" ]
15+
then
16+
sed "s/${LINE}/${INCREMENTED}/" $FULLPATH > $FULLPATH.tmp && mv $FULLPATH.tmp $FULLPATH
17+
echo "Updated ${INCREMENTED} in ${FULLPATH}";
18+
else
19+
echo "Something went wrong in VERSION increment"
20+
exit 1
21+
fi
22+
fi;

lib/core/settings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
from lib.core.revision import getRevisionNumber
2121

2222
# sqlmap version and site
23-
VERSION = "1.0-stable"
23+
VERSION = "1.0.0"
2424
REVISION = getRevisionNumber()
25-
VERSION_STRING = "sqlmap/%s" % VERSION
25+
COMMIT_AUTOINCREMENT = 2
26+
VERSION_STRING = "sqlmap/%s.%d" % (VERSION, COMMIT_AUTOINCREMENT)
2627
DESCRIPTION = "automatic SQL injection and database takeover tool"
2728
SITE = "http://sqlmap.org"
2829
ISSUES_PAGE = "https://github.com/sqlmapproject/sqlmap/issues/new"

0 commit comments

Comments
 (0)