File: post-commit.py

package info (click to toggle)
commitizen 4.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,672 kB
  • sloc: python: 14,530; makefile: 15
file content (21 lines) | stat: -rwxr-xr-x 436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
from pathlib import Path

try:
    from commitizen.cz.utils import get_backup_file_path
except ImportError as error:
    print(f"could not import commitizen:\n{error}")
    exit(1)


def post_commit() -> None:
    backup_file = Path(get_backup_file_path())

    # remove backup file if it exists
    if backup_file.is_file():
        backup_file.unlink()


if __name__ == "__main__":
    post_commit()
    exit(0)