mirror of
https://github.com/corpnewt/gibMacOS.git
synced 2024-09-21 03:00:59 +02:00
Sort by version, not date when using -v/-l
This commit is contained in:
parent
fa2a606309
commit
c313546e55
@ -291,8 +291,7 @@ class gibMacOS:
|
|||||||
if not len(self.mac_prods):
|
if not len(self.mac_prods):
|
||||||
print("No installers in catalog!")
|
print("No installers in catalog!")
|
||||||
print("")
|
print("")
|
||||||
exit()
|
for p in sorted(self.mac_prods, key=lambda x:x['version'], reverse=True):
|
||||||
for p in self.mac_prods:
|
|
||||||
num += 1
|
num += 1
|
||||||
var1 = "{}. {} {}".format(num, p["title"], p["version"])
|
var1 = "{}. {} {}".format(num, p["title"], p["version"])
|
||||||
var2 = " - {} - Added {}".format(p["product"], p["date"])
|
var2 = " - {} - Added {}".format(p["product"], p["date"])
|
||||||
@ -340,7 +339,7 @@ class gibMacOS:
|
|||||||
def get_latest(self, dmg = False):
|
def get_latest(self, dmg = False):
|
||||||
self.u.head("Downloading Latest")
|
self.u.head("Downloading Latest")
|
||||||
print("")
|
print("")
|
||||||
self.download_prod(self.mac_prods[-1], dmg)
|
self.download_prod(sorted(self.mac_prods, key=lambda x:x['version'], reverse=True)[0], dmg)
|
||||||
|
|
||||||
def get_for_product(self, prod, dmg = False):
|
def get_for_product(self, prod, dmg = False):
|
||||||
self.u.head("Downloading for {}".format(prod))
|
self.u.head("Downloading for {}".format(prod))
|
||||||
@ -360,7 +359,7 @@ class gibMacOS:
|
|||||||
for n in self.version_names:
|
for n in self.version_names:
|
||||||
v_dict[self.version_names[n]] = n
|
v_dict[self.version_names[n]] = n
|
||||||
n = v_dict.get(v, v)
|
n = v_dict.get(v, v)
|
||||||
for p in self.mac_prods:
|
for p in sorted(self.mac_prods, key=lambda x:x['version'], reverse=True):
|
||||||
pt = p["title"].lower()
|
pt = p["title"].lower()
|
||||||
pv = p["version"].lower()
|
pv = p["version"].lower()
|
||||||
# Need to compare verisons - n = name, v = version
|
# Need to compare verisons - n = name, v = version
|
||||||
|
Loading…
Reference in New Issue
Block a user