1
0
mirror of https://github.com/oskar456/dzonegit.git synced 2024-05-11 05:55:41 +00:00

Add setup.py

This commit is contained in:
Ondřej Caletka
2018-07-07 22:02:18 +02:00
parent ef26082735
commit 3614beba9e
3 changed files with 51 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import subprocess
import re
from collections import namedtuple
@ -172,7 +173,7 @@ def check_updated_zones(against):
pass # Old version of zone did not exist
def main():
def pre_commit():
against = get_head()
try:
check_whitespace_errors(against)
@ -182,5 +183,14 @@ def main():
raise SystemExit(1)
def main():
name = Path(sys.argv[0]).name
print(name)
if name == "pre-commit":
pre_commit()
else:
sys.exit("No valid command found")
if __name__ == "__main__":
main()