This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Igor Shishkin <[email protected]>
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local LrHttp = import 'LrHttp' | ||
local LrDialogs = import 'LrDialogs' | ||
local LrTasks = import 'LrTasks' | ||
|
||
local json = require 'JSON' | ||
json.strictTypes = true | ||
|
||
require 'Info' | ||
|
||
function checkForUpdates() | ||
local responseBody, headers = LrHttp.get(latestReleaseJsonUrl) | ||
r = json:decode(responseBody) | ||
if r['tag_name'] ~= plugin_version then | ||
local referToNewRelease = LrDialogs.confirm( | ||
'Update is available!', | ||
'Release ' .. r['tag_name'] .. ' is present, wanna visit release page?', | ||
'Yes, I want to download an update!', | ||
'No, thanks.' | ||
) | ||
|
||
if referToNewRelease == 'ok' then | ||
LrHttp.openUrlInBrowser(r['html_url']) | ||
end | ||
end | ||
end | ||
|
||
LrTasks.startAsyncTask(checkForUpdates) |
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