mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- fix Updater extension
This commit is contained in:
parent
bcafe5c031
commit
8d6935e7a3
2 changed files with 7 additions and 3 deletions
|
|
@ -38,11 +38,15 @@ class Updater
|
|||
}
|
||||
$a = json_decode($json, true) ?? [];
|
||||
$ret = [];
|
||||
if ( isset($a['name']) && isset($a['assets']) &&
|
||||
$ver = '';
|
||||
if (isset($a['tag_name'])) {
|
||||
$ver = substr($a['tag_name'], 1); //remove first 'v'
|
||||
}
|
||||
if ($ver != '' && isset($a['assets']) &&
|
||||
is_array($a['assets']) && count($a['assets']) > 0 &&
|
||||
($asset = $a['assets'][0]) && isset($asset['browser_download_url']) )
|
||||
{
|
||||
$ret['version'] = substr($a['name'], 1); //remove first 'v'
|
||||
$ret['version'] = $ver;
|
||||
$ret['download'] = $asset['browser_download_url'];
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"bundleId": "updater",
|
||||
"name": "Updates",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.2",
|
||||
"description": "myTinyTodo self-updater"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue