Skip to content

Commit 10867cf

Browse files
committed
homebrew support & correct --version
1 parent e239280 commit 10867cf

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# gitfetch
2+
23
A neofetch-style CLI tool for GitHub statistics. Display your GitHub profile and stats in a beautiful, colorful terminal interface.
34

45
<img width="3024" height="1964" alt="image" src="https://github.com/user-attachments/assets/bbb18d5d-4787-4998-a352-e8f4e59642c0" />
@@ -46,8 +47,21 @@ You should see: `✓ Logged in to github.com as YOUR_USERNAME`
4647

4748
## Installing `gitfetch`
4849

50+
### macOS (Homebrew)
51+
52+
```bash
53+
brew tap matars/homebrew-gitfetch
54+
brew install gitfetch
55+
```
56+
57+
Or install directly without tapping:
58+
59+
```bash
60+
brew install matars/homebrew-gitfetch/gitfetch
61+
```
62+
4963
### From the sources
50-
64+
5165
1. Clone this repo
5266
2. `cd` into the repo
5367
3. Then type the below command

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "gitfetch"
7-
version = "1.0.2"
7+
version = "1.0.3"
88
description = "A neofetch-style CLI tool for GitHub statistics"
99
readme = "README.md"
1010
requires-python = ">=3.8"

src/gitfetch/__init__.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,22 @@
22
gitfetch - A neofetch-style CLI tool for GitHub statistics
33
"""
44

5-
__version__ = "0.1.0"
5+
import re
6+
from pathlib import Path
7+
8+
9+
def _get_version() -> str:
10+
"""Get version from pyproject.toml."""
11+
pyproject_path = Path(__file__).parent.parent.parent / "pyproject.toml"
12+
try:
13+
with open(pyproject_path, "r", encoding="utf-8") as f:
14+
content = f.read()
15+
match = re.search(r'^version\s*=\s*"([^"]+)"', content, re.MULTILINE)
16+
if match:
17+
return match.group(1)
18+
except (FileNotFoundError, OSError):
19+
pass
20+
return "unknown"
21+
22+
23+
__version__ = _get_version()

src/gitfetch/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .display import DisplayFormatter
1111
from .cache import CacheManager
1212
from .config import ConfigManager
13+
from . import __version__
1314

1415

1516
def parse_args() -> argparse.Namespace:
@@ -46,7 +47,7 @@ def parse_args() -> argparse.Namespace:
4647
parser.add_argument(
4748
"--version",
4849
action="version",
49-
version="%(prog)s 0.1.0"
50+
version=f"%(prog)s {__version__}"
5051
)
5152

5253
return parser.parse_args()

0 commit comments

Comments
 (0)