Skip to content

Commit

Permalink
Create update.rhai
Browse files Browse the repository at this point in the history
Signed-off-by: Dipta Biswas <[email protected]>
  • Loading branch information
hazel-bunny authored Apr 5, 2024
1 parent 9bf1785 commit 4ad0ab9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions anda/themes/lightly-qt5/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let repos = get("https://repology.org/api/v1/project/qt").json_arr();
let branch = sh("git rev-parse --abbrev-ref HEAD", #{"stdout": "piped"}).ctx.stdout;
branch.crop(1);
branch.trim();
let vers = repos.filter(|r| r.repo == `fedora_${branch}`).map(|r| [find("^(\\d+)\\.(\\d+)\\..+$", r.version, 1), find("^(\\d+)\\.(\\d+)\\..+$", r.version, 2)]);
let ver = vers.find(|v| v[0] == "5")[1]; // assume there is only 1 package for v5.x
open_file("anda/themes/lightly-qt5/VER5.txt").write(`${ver}`); // will trig rebuild when changed

0 comments on commit 4ad0ab9

Please sign in to comment.