mirror of
https://github.com/oskar456/dzonegit.git
synced 2024-05-11 05:55:41 +00:00
Revert "Drop dzonegit multi-call executable"
This reverts commit 9a521350d3
.
Since there is no Python dependency, it may be actually handy to call
the script as is.
This commit is contained in:
19
dzonegit.py
19
dzonegit.py
@ -493,3 +493,22 @@ def post_receive(stdin=sys.stdin):
|
|||||||
cmd.append(z)
|
cmd.append(z)
|
||||||
print("Calling {}…".format(" ".join(cmd)))
|
print("Calling {}…".format(" ".join(cmd)))
|
||||||
subprocess.run(cmd)
|
subprocess.run(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
name = Path(sys.argv[0]).name
|
||||||
|
print(name)
|
||||||
|
if name == "pre-commit":
|
||||||
|
pre_commit()
|
||||||
|
elif name == "update":
|
||||||
|
update()
|
||||||
|
elif name == "pre-receive":
|
||||||
|
pre_receive()
|
||||||
|
elif name == "post-receive":
|
||||||
|
post_receive()
|
||||||
|
else:
|
||||||
|
sys.exit("No valid command found")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
1
setup.py
1
setup.py
@ -19,6 +19,7 @@ setup(
|
|||||||
tests_require=["pytest"],
|
tests_require=["pytest"],
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": [
|
"console_scripts": [
|
||||||
|
"dzonegit = dzonegit:main",
|
||||||
"dzonegit-pre-commit = dzonegit:pre_commit",
|
"dzonegit-pre-commit = dzonegit:pre_commit",
|
||||||
"dzonegit-pre-receive = dzonegit:pre_receive",
|
"dzonegit-pre-receive = dzonegit:pre_receive",
|
||||||
"dzonegit-post-receive = dzonegit:post_receive",
|
"dzonegit-post-receive = dzonegit:post_receive",
|
||||||
|
Reference in New Issue
Block a user