Skip to content

Commit

Permalink
add option to change version
Browse files Browse the repository at this point in the history
  • Loading branch information
alchem0x2A committed Jan 15, 2024
1 parent 595a7a1 commit c0767fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sparc/docparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ def json_from_repo(
download_dir = tmpdir / "SPARC"
download_cmds = ["git", "clone", "--depth", "1", str(url), "SPARC"]
run(download_cmds, cwd=tmpdir)
if version not in ["master", "HEAD"]:
fetch_cmds = ["git", "fetch", "--depth", "1", str(version)]
run(fetch_cmds, cwd=download_dir)
checkout_cmds = ["git", "checkout", str(version)]
run(checkout_cmds, cwd=download_dir)
json_string = cls.json_from_directory(
directory=download_dir / "doc" / ".LaTeX",
include_subdirs=include_subdirs,
Expand Down

0 comments on commit c0767fa

Please sign in to comment.