about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/parsing/tree-sitter/update.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/development/tools/parsing/tree-sitter/update.nix b/pkgs/development/tools/parsing/tree-sitter/update.nix
index 1257e099d4417..d4b66f83beff6 100644
--- a/pkgs/development/tools/parsing/tree-sitter/update.nix
+++ b/pkgs/development/tools/parsing/tree-sitter/update.nix
@@ -423,7 +423,7 @@ let
     jsonArg = json.loads(sys.argv[2])
 
 
-    def curl_args(orga, repo, token):
+    def curl_github_args(token, url):
         """Query the github API via curl"""
         yield "curl"
         if not debug:
@@ -431,7 +431,7 @@ let
         if token:
             yield "-H"
             yield f"Authorization: token {token}"
-        yield f"https://api.github.com/repos/{quote(orga)}/{quote(repo)}/releases/latest"
+        yield url
 
 
     def curl_result(orga, repo, output):
@@ -464,7 +464,10 @@ let
         match jsonArg:
             case {"orga": orga, "repo": repo}:
                 token = os.environ.get("GITHUB_TOKEN", None)
-                curl_cmd = list(curl_args(orga, repo, token))
+                curl_cmd = list(curl_github_args(
+                    token,
+                    url=f"https://api.github.com/repos/{quote(orga)}/{quote(repo)}/releases/latest"
+                ))
                 if debug:
                     print(curl_cmd, file=sys.stderr)
                 out = sub.check_output(curl_cmd)