tree-sitter/update: get executables from nix instead of environment
This was a small bug, the update script should of course not depend on any executables in the environment. Since we don’t use a nix string anymore, interpolation is out of the question, so we pass it as arglib environment json string.
This commit is contained in:
@@ -408,9 +408,15 @@ let
|
||||
urlEscape = x: x;
|
||||
|
||||
# implementation of the fetching of repo information from github
|
||||
fetchImpl = writers.writePython3 "fetchImpl" {
|
||||
flakeIgnore = ["E501"];
|
||||
} ./update_impl.py;
|
||||
fetchImpl = writeShellScript "fetchImpl-wrapped" ''
|
||||
env ARGLIB_JSON=${lib.escapeShellArg (lib.generators.toJSON {} {
|
||||
curl = "${curl}/bin/curl";
|
||||
nix-prefetch-git = "${nix-prefetch-git}/bin/nix-prefetch-git";
|
||||
})} \
|
||||
${writers.writePython3 "fetchImpl" {
|
||||
flakeIgnore = ["E501"];
|
||||
} ./update_impl.py} "$@"
|
||||
'';
|
||||
|
||||
# find the latest repos of a github organization
|
||||
latestGithubRepos = { orga }: writeShellScript "latest-github-repos" ''
|
||||
|
||||
@@ -5,6 +5,7 @@ import os
|
||||
import sys
|
||||
|
||||
debug = True if os.environ.get("DEBUG", False) else False
|
||||
bins = json.loads(os.environ['ARGLIB_JSON'])
|
||||
|
||||
mode = sys.argv[1]
|
||||
jsonArg = json.loads(sys.argv[2])
|
||||
@@ -12,7 +13,7 @@ jsonArg = json.loads(sys.argv[2])
|
||||
|
||||
def curl_github_args(token, url):
|
||||
"""Query the github API via curl"""
|
||||
yield "curl"
|
||||
yield bins["curl"]
|
||||
if not debug:
|
||||
yield "--silent"
|
||||
if token:
|
||||
@@ -36,7 +37,7 @@ def curl_result(orga, repo, output):
|
||||
|
||||
def nix_prefetch_args(url, version_rev):
|
||||
"""Prefetch a git repository"""
|
||||
yield "nix-prefetch-git"
|
||||
yield bins["nix-prefetch-git"]
|
||||
if not debug:
|
||||
yield "--quiet"
|
||||
yield "--no-deepClone"
|
||||
|
||||
Reference in New Issue
Block a user