Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resource now checks to see if it's running the latest version. Then, in 30 min intervals, checks if any updates are available. Documented the `blips generate` command. Some poeple might not have known about it otherwise.
- Loading branch information
Showing
4 changed files
with
108 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
local url = "https://gist.githubusercontent.com/TGRHavoc/581ec66730b7abafe49ab616db87b0bb/raw/f27c6f2573dd1df0692f97c78a73f5687d20f791/live_map.versions" | ||
local version = "2.1.4" | ||
local latest = true | ||
|
||
function checkForUpdate() | ||
PerformHttpRequest(url, function(err, data, headers) | ||
local parsed = json.decode(data) | ||
|
||
if (parsed["resource"] ~= version) then | ||
print("|===================================================|") | ||
print("| Live Map Update Available |") | ||
print("| Download at: https://github.com/TGRHavoc/live_map |") | ||
print("|===================================================|") | ||
latest = false -- Stop running the timeout | ||
end | ||
|
||
if (latest) then -- If it's the latest then check for updates every 30 mins | ||
SetTimeout( 30 * (60*1000), checkForUpdate) | ||
end | ||
|
||
end, "GET", "", { ["Content-Type"] = 'application/json' }) | ||
|
||
end | ||
|
||
|
||
checkForUpdate(); |