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

Skip to content

Commit 8f9979c

Browse files
committed
Patch for an Issue #541
1 parent 5fb8ae9 commit 8f9979c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/core/update.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ def update():
2727
return
2828

2929
success = False
30-
rootDir = paths.SQLMAP_ROOT_PATH
3130

32-
if not os.path.exists(os.path.join(rootDir, ".git")):
31+
if not os.path.exists(os.path.join(paths.SQLMAP_ROOT_PATH, ".git")):
3332
errMsg = "not a git repository. Please checkout the 'sqlmapproject/sqlmap' repository "
3433
errMsg += "from GitHub (e.g. 'git clone https://github.com/sqlmapproject/sqlmap.git sqlmap')"
3534
logger.error(errMsg)
@@ -44,7 +43,7 @@ def update():
4443
dataToStdout("\r[%s] [INFO] update in progress " % time.strftime("%X"))
4544

4645
try:
47-
process = execute("git checkout . && git pull %s HEAD" % GIT_REPOSITORY, shell=True, stdout=PIPE, stderr=PIPE)
46+
process = execute("git checkout . && git pull %s HEAD" % GIT_REPOSITORY, shell=True, stdout=PIPE, stderr=PIPE, cwd=paths.SQLMAP_ROOT_PATH)
4847
pollProcess(process, True)
4948
stdout, stderr = process.communicate()
5049
success = not process.returncode

0 commit comments

Comments
 (0)