2021-02-05 17:12:51 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2023-08-04 22:07:22 +00:00
|
|
|
#!nix-shell -i python3 -p nix-update python3Packages.requests
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
import requests
|
|
|
|
import subprocess
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
REPOS = [
|
|
|
|
"libime",
|
|
|
|
"xcb-imdkit",
|
|
|
|
|
|
|
|
"fcitx5",
|
2023-01-20 10:41:00 +00:00
|
|
|
"fcitx5-anthy",
|
2022-02-10 20:34:41 +00:00
|
|
|
"fcitx5-chewing",
|
|
|
|
"fcitx5-chinese-addons",
|
|
|
|
"fcitx5-configtool",
|
|
|
|
"fcitx5-gtk",
|
|
|
|
"fcitx5-hangul",
|
|
|
|
"fcitx5-lua",
|
|
|
|
"fcitx5-m17n",
|
|
|
|
"fcitx5-qt",
|
|
|
|
"fcitx5-rime",
|
2023-05-24 13:37:59 +00:00
|
|
|
"fcitx5-skk",
|
2022-02-10 20:34:41 +00:00
|
|
|
"fcitx5-table-extra",
|
|
|
|
"fcitx5-table-other",
|
|
|
|
"fcitx5-unikey"
|
|
|
|
]
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
OWNER = "fcitx"
|
|
|
|
|
|
|
|
def get_latest_tag(repo, owner=OWNER):
|
2021-06-28 23:13:55 +00:00
|
|
|
r = requests.get('https://api.github.com/repos/{}/{}/tags'.format(owner,repo))
|
2021-02-05 17:12:51 +00:00
|
|
|
return r.json()[0].get("name")
|
|
|
|
|
|
|
|
def main():
|
|
|
|
for repo in REPOS:
|
|
|
|
rev = get_latest_tag(repo)
|
|
|
|
if repo == "fcitx5-qt":
|
|
|
|
subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
|
|
|
|
else:
|
|
|
|
subprocess.run(["nix-update", "--commit", "--version", rev, repo])
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main ()
|