From 8f9979c3022727063a8c1679067c5c584f739021 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 22 Oct 2015 20:51:05 +0200 Subject: [PATCH] Patch for an Issue #541 --- lib/core/update.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/core/update.py b/lib/core/update.py index 3e0b38dd8..3636ba40a 100644 --- a/lib/core/update.py +++ b/lib/core/update.py @@ -27,9 +27,8 @@ def update(): return success = False - rootDir = paths.SQLMAP_ROOT_PATH - if not os.path.exists(os.path.join(rootDir, ".git")): + if not os.path.exists(os.path.join(paths.SQLMAP_ROOT_PATH, ".git")): errMsg = "not a git repository. Please checkout the 'sqlmapproject/sqlmap' repository " errMsg += "from GitHub (e.g. 'git clone https://github.com/sqlmapproject/sqlmap.git sqlmap')" logger.error(errMsg) @@ -44,7 +43,7 @@ def update(): dataToStdout("\r[%s] [INFO] update in progress " % time.strftime("%X")) try: - process = execute("git checkout . && git pull %s HEAD" % GIT_REPOSITORY, shell=True, stdout=PIPE, stderr=PIPE) + process = execute("git checkout . && git pull %s HEAD" % GIT_REPOSITORY, shell=True, stdout=PIPE, stderr=PIPE, cwd=paths.SQLMAP_ROOT_PATH) pollProcess(process, True) stdout, stderr = process.communicate() success = not process.returncode