biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / inputmethods / fcitx5 / update.py
blob8fa59d2926e2efa393d58d712dcaf407da99daf8
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i python3 -p nix-update python3Packages.requests
4 import requests
5 import subprocess
7 REPOS = [
8 "libime",
9 "xcb-imdkit",
11 "fcitx5",
12 "fcitx5-anthy",
13 "fcitx5-chewing",
14 "fcitx5-chinese-addons",
15 "fcitx5-configtool",
16 "fcitx5-gtk",
17 "fcitx5-hangul",
18 "fcitx5-lua",
19 "fcitx5-m17n",
20 "fcitx5-qt",
21 "fcitx5-rime",
22 "fcitx5-skk",
23 "fcitx5-table-extra",
24 "fcitx5-table-other",
25 "fcitx5-unikey"
28 OWNER = "fcitx"
30 def get_latest_tag(repo, owner=OWNER):
31 r = requests.get('https://api.github.com/repos/{}/{}/tags'.format(owner,repo))
32 return r.json()[0].get("name")
34 def main():
35 for repo in REPOS:
36 rev = get_latest_tag(repo)
37 if repo == "fcitx5-qt":
38 subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
39 else:
40 subprocess.run(["nix-update", "--commit", "--version", rev, repo])
42 if __name__ == "__main__":
43 main ()