Download stackgo/stackbuild/info_cli.py from s0duku/the-stack-go: direct link, hf CLI and curl.
- Browser
- Download file 931 Bytes
-
https://huggingface.co/datasets/s0duku/the-stack-go/resolve/main/stackgo/stackbuild/info_cli.py
- Command line
-
hf download hf://datasets/s0duku/the-stack-go/stackgo/stackbuild/info_cli.py
-
curl -L -o info_cli.py https://huggingface.co/datasets/s0duku/the-stack-go/resolve/main/stackgo/stackbuild/info_cli.py
931 Bytes
| from __future__ import annotations | |
| import argparse | |
| import json | |
| from .repo_filesystem import repo_from_path | |
| from .repo_scanner import scan | |
| from .repo_serialization import to_dict, write_json | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description="Build dependency metadata for a repository checkout") | |
| parser.add_argument("repository") | |
| parser.add_argument("--repo-id") | |
| parser.add_argument("--revision-id", default="working-tree") | |
| parser.add_argument("--output") | |
| parser.add_argument("--include-weak", action="store_true") | |
| args = parser.parse_args() | |
| info = scan(repo_from_path(args.repository, repo_id=args.repo_id, | |
| revision_id=args.revision_id), include_weak=args.include_weak) | |
| if args.output: | |
| write_json(info, args.output) | |
| else: | |
| print(json.dumps(to_dict(info), ensure_ascii=False, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |