Page MenuHomeSoftware Heritage
Paste P1133

old yarnpkg support
ActivePublic

Authored by vlorentz on Aug 25 2021, 1:57 PM.
diff --git a/setup.py b/setup.py
index 3929a46..bf3108d 100755
--- a/setup.py
+++ b/setup.py
@@ -132,8 +132,8 @@ def generate_parser(dest_path):
shutil.copytree("swh/search/query_language", dest_path)
print("Getting path")
- path = subprocess.check_output([yarn, "-s", "path"])
- env = {**os.environ, "PATH": path}
+ path = subprocess.check_output([yarn, "bin"]).decode().strip()
+ env = {**os.environ, "PATH": os.pathsep.join([path, os.environ["PATH"]])}
print("Generating")
subprocess.run(["tree-sitter", "generate", "--no-bindings"], cwd=dest_path, env=env)