Spaces:
Sleeping
Sleeping
Download check_git.py from VJ24/ai-observability: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/spaces/VJ24/ai-observability/resolve/main/check_git.py
- Command line
-
hf download hf://spaces/VJ24/ai-observability/check_git.py
-
curl -L -o check_git.py https://huggingface.co/spaces/VJ24/ai-observability/resolve/main/check_git.py
476 Bytes
| import subprocess | |
| def run_git_cmd(cmd): | |
| try: | |
| result = subprocess.run( | |
| cmd, | |
| capture_output=True, | |
| text=True, | |
| check=True) | |
| print(f"--- Output of {' '.join(cmd)} ---") | |
| print(result.stdout) | |
| except subprocess.CalledProcessError as e: | |
| print(f"Error running {' '.join(cmd)}: {e.stderr}") | |
| if __name__ == "__main__": | |
| run_git_cmd(["git", "status"]) | |
| run_git_cmd(["git", "log", "-n", "3"]) | |