Merge pull request 'Default to null 'rv' for plugin update check.' (#17) from wn/tt-rss:inaccurate-available-plugin-updates into master

Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/17
master
fox 4 years ago
commit 9b2267510b

@ -1057,7 +1057,7 @@ class Pref_Prefs extends Handler_Protected {
private static function _plugin_needs_update($root_dir, $plugin_name) {
$plugin_dir = "$root_dir/plugins.local/" . basename($plugin_name);
$rv = [];
$rv = null;
if (is_dir($plugin_dir) && is_dir("$plugin_dir/.git")) {
$pipes = [];
@ -1071,9 +1071,11 @@ class Pref_Prefs extends Handler_Protected {
$proc = proc_open("git fetch -q origin -a && git log HEAD..origin/master --oneline", $descriptorspec, $pipes, $plugin_dir);
if (is_resource($proc)) {
$rv["stdout"] = stream_get_contents($pipes[1]);
$rv["stderr"] = stream_get_contents($pipes[2]);
$rv["git_status"] = proc_close($proc);
$rv = [
"stdout" => stream_get_contents($pipes[1]),
"stderr" => stream_get_contents($pipes[2]),
"git_status" => proc_close($proc),
];
$rv["need_update"] = !empty($rv["stdout"]);
}
}

@ -697,6 +697,7 @@ const Helpers = {
} else {
reply.forEach((p) => {
if (p.rv) {
if (p.rv.need_update) {
dialog.plugins_to_update.push(p.plugin);
@ -720,6 +721,7 @@ const Helpers = {
</li>
`
}
}
dialog.checkNextPlugin();
});
}

Loading…
Cancel
Save