1
0
mirror of https://github.com/kepler155c/opus synced 2024-12-29 01:50:27 +00:00

more work on update notification

This commit is contained in:
kepler155c@gmail.com 2020-05-01 22:26:15 -06:00
parent c1cbcf6b61
commit 9c97849cff
3 changed files with 21 additions and 12 deletions

View File

@ -22,11 +22,12 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# Runs a single command using the runners shell - name: Create version file
- name: Run a one-line script run: |
run: echo `date` > .opus_version echo `date` > .opus_version
git log -8 --pretty=format:'%s (%cr)' >> .opus_version
- name: Update version file - name: Commit version file
uses: alexesprit/action-update-file@master uses: alexesprit/action-update-file@master
with: with:
branch: 'develop-1.8' branch: 'develop-1.8'

View File

@ -9,22 +9,28 @@ if not config.current then
end end
UI:setPage(UI.Page { UI:setPage(UI.Page {
UI.Text {
x = 2, y = 2, ex = -2,
align = 'center',
value = 'Opus has been updated.',
textColor = 'yellow',
},
UI.TextArea { UI.TextArea {
x = 2, y = 2, ey = -2, x = 2, y = 4, ey = -8,
value = 'A new version of Opus is available.' text = config.details,
}, },
UI.Button { UI.Button {
x = 2, y = 5, width = 21, x = 2, y = -6, width = 21,
event = 'skip', event = 'skip',
text = 'Skip this version', text = 'Skip this version',
}, },
UI.Button { UI.Button {
x = 2, y = 7, width = 21, x = 2, y = -4, width = 21,
event = 'remind', event = 'remind',
text = 'Remind me tomorrow', text = 'Remind me tomorrow',
}, },
UI.Button { UI.Button {
x = 2, y = 9, width = 21, x = 2, y = -2, width = 21,
event = 'update', event = 'update',
text = 'Update' text = 'Update'
}, },

View File

@ -36,9 +36,11 @@ if fs.exists('.opus_version') then
pcall(function() pcall(function()
local c = Util.httpGet(string.format(URL, _G.OPUS_BRANCH)) local c = Util.httpGet(string.format(URL, _G.OPUS_BRANCH))
if c then if c then
c = Util.split(c)[1] local lines = Util.split(c)
if config.opus ~= c and config.skip ~= c then local revdate = table.remove(lines, 1)
config.current = c if config.opus ~= revdate and config.skip ~= revdate then
config.current = revdate
config.details = table.concat(lines, '\n')
Config.update('version', config) Config.update('version', config)
print('New version available') print('New version available')
if _ENV.multishell then if _ENV.multishell then