1
0
mirror of https://github.com/kepler155c/opus synced 2025-11-15 14:57:11 +00:00

update notification

This commit is contained in:
kepler155c@gmail.com
2020-04-30 21:27:07 -06:00
parent e721eb68b6
commit 3368fa3266
2 changed files with 53 additions and 6 deletions

View File

@@ -6,15 +6,11 @@ local shell = _ENV.shell
local URL = 'https://raw.githubusercontent.com/kepler155c/opus/%s/.opus_version'
local function notifyUpdate(config)
print('Opus has been updated to: ' .. config.current)
read()
end
if fs.exists('.opus_version') then
local f = fs.open('.opus_version')
local date = f.readLine()
f.close()
date = type(date) == 'string' and Util.split(date)[1]
if type(date) == 'string' and #date > 0 then
local today = os.date('%j')
@@ -44,7 +40,10 @@ if fs.exists('.opus_version') then
if config.opus ~= c and config.skip ~= c then
config.current = c
Config.update('version', config)
notifyUpdate(config)
print('New version available')
if _ENV.multishell then
shell.openForegroundTab('Version')
end
end
end
end)