1#!/usr/bin/env nix-shell
2#!nix-shell -i python3 -p nix-update python3Packages.requests
3
4import requests
5import subprocess
6
7REPOS = [
8 "libime",
9 "xcb-imdkit",
10
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"
26 ]
27
28OWNER = "fcitx"
29
30def 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")
33
34def 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])
41
42if __name__ == "__main__":
43 main ()