Commit 03e1c565 authored by Nong Hoang Tu's avatar Nong Hoang Tu

Correct notification when user is having multiple branches

parent 90da776f
Pipeline #713 failed with stages
......@@ -61,6 +61,7 @@ proc sendNotify(sumary, body, icon: string) =
proc checkUpdate() =
var numOutOfDated = 0
for line in lines(repoConfig):
if line.startsWith("deb "):
let
......@@ -77,16 +78,18 @@ proc checkUpdate() =
let
localDate = parseDateFromFile(fileFromURL)
serverDate = parseDateFromText(updateServerChange(urlToRepoURL(mirror.url, mirror.edition)))
if localDate == serverDate:
echo "[*] Your system is up to date"
sendNotify("Parrot Updater", "Your system is up to date", "security-high")
else:
echo "[!] New update is available"
sendNotify("Parrot Updater", "New update is available", "security-low")
if localDate != serverDate:
echo "[!] New update is available on " & mirror.edition
echo "[+] Your last update: " & localDate
echo "[+] Repo last update: " & serverDate
sendNotify("Server last update: " & serverDate, "Local last update: " & localDate, "security-low")
sendNotify("New update is available on " & mirror.edition, "Server " & serverDate & "\nMachine " & localDate, "security-low")
numOutOfDated += 1
if numOutOfDated == 0:
echo "[*] Your system is up to date"
sendNotify("Parrot Updater", "Your system is up to date", "security-high")
else:
echo "[!] Your system need to update"
sendNotify("New update is available", "Run command \"sudo parrot-upgrade\" to upgrade your system", "security-high")
proc onClickYes(b: Button) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment