Skip to content

Commit

Permalink
update via git pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Mee authored and Jim Mee committed May 7, 2020
1 parent 96bb06e commit e1088e7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/cli/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def dynamic_proxy(self, target_ip):

return False
except BaseException as exc:
console.print_warning(f"[-] Error: cannot read proxy: {resp.text}\nException: {exc}")
console.print_warning(
f"[-] Error: cannot read proxy: {resp.text}\nException: {exc}")

return False
proxy_addr = proxy_addr.split('://')[-1]
Expand Down Expand Up @@ -222,9 +223,9 @@ def update(res):

os.chdir(MECROOT)

# refresh local git repo
# pull all tags
try:
check = "git remote -v update"
check = "git pull --tags"
out = subprocess.check_output(
["/bin/sh", "-c", check],
stderr=subprocess.STDOUT, timeout=30)
Expand All @@ -236,14 +237,14 @@ def update(res):

return

if "[up to date]" in check_res:
if "Already up to date" in check_res:

res['status'] = "[+] already up to date"

return

# pull if needed
pull = "git pull --depth=1 --tags"
pull = "git pull"
try:
out = subprocess.check_output(
["/bin/sh", "-c", pull],
Expand Down Expand Up @@ -594,8 +595,6 @@ def get_version():
["/bin/sh", "-c", check],
stderr=subprocess.STDOUT, timeout=3)

return ""

return out.decode("utf-8")


Expand Down

0 comments on commit e1088e7

Please sign in to comment.