From e1088e7488e5e6bbf90d4910a92a11be748c13f4 Mon Sep 17 00:00:00 2001
From: Jim Mee <jm33@jm33-MBP-16.local>
Date: Thu, 7 May 2020 13:04:18 +0800
Subject: [PATCH] update via git pull

---
 lib/cli/core.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/cli/core.py b/lib/cli/core.py
index 93c5c55..918f9c4 100644
--- a/lib/cli/core.py
+++ b/lib/cli/core.py
@@ -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]
@@ -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)
@@ -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],
@@ -594,8 +595,6 @@ def get_version():
             ["/bin/sh", "-c", check],
             stderr=subprocess.STDOUT, timeout=3)
 
-        return ""
-
     return out.decode("utf-8")