Skip to content

Commit

Permalink
Fix retrieving version numbrer for dnf 5
Browse files Browse the repository at this point in the history
  • Loading branch information
purejava committed Nov 3, 2024
1 parent 2af787f commit 68c57fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ class FedoraUpdateIndicator extends Button {
proc.communicate_utf8_async(null, null, (proc, res) => {
let [, stdout, ] = proc.communicate_utf8_finish(res);
if (proc.get_successful()) {
let m = stdout.match(/^\d/gm);
if (m !== null) {
resolve(m[0]);
let m = 0;
for (const match of stdout.matchAll((/^(\w*\s\w*\s)?(\d)/g))) {
m = match[2];
}
if (m !== 0) {
resolve(m);
} else {
reject(new Error("Version match not found"));
}
Expand Down

0 comments on commit 68c57fe

Please sign in to comment.