25 lines
626 B
Python
25 lines
626 B
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""Increment the patch component in the tracked VERSION file."""
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
import sys
|
||
|
|
|
||
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||
|
|
sys.path.insert(0, str(PROJECT_ROOT))
|
||
|
|
|
||
|
|
from snooper_version import bump_patch
|
||
|
|
|
||
|
|
|
||
|
|
def main() -> int:
|
||
|
|
path = PROJECT_ROOT / "VERSION"
|
||
|
|
current = path.read_text(encoding="utf-8").strip()
|
||
|
|
updated = bump_patch(current)
|
||
|
|
path.write_text(updated + "\n", encoding="utf-8")
|
||
|
|
print(f"{current} -> {updated}")
|
||
|
|
print("请将 VERSION 的变更纳入下一次 commit。")
|
||
|
|
return 0
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
raise SystemExit(main())
|