Skip to content

Commit c0e8c7c

Browse files
committed
cli: fix #1, exit codes are now propagated from click.
1 parent 5556488 commit c0e8c7c

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CHANGES

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ Changes
33
=======
44

55

6+
0.3.0 (*2022-08-07*)
7+
====================
8+
9+
- cli: fix #1, exit codes are now propagated from click.
10+
11+
612
0.2.0 (*2022-04-21*)
713
====================
814

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pydevtool
3-
version = 0.2.0
3+
version = 0.3.0
44
author = Eduardo Naufel Schettino
55
author_email = [email protected]
66
description = CLI dev tools powered by pydoit

src/pydevtool/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = (0, 2, 0)
1+
__version__ = (0, 3, 0)

src/pydevtool/cli.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def task_meta(cls, **kwargs):
100100
'''
101101

102102
import re
103+
import sys
103104

104105
import click
105106
from click.globals import get_current_context
@@ -263,11 +264,11 @@ def register_click(cls):
263264
if issubclass(cls, Task):
264265
# run as doit task
265266
def callback(**kwargs):
266-
self.run_doit_task.__func__({name: kwargs})
267+
sys.exit(self.run_doit_task.__func__({name: kwargs}))
267268
else:
268269
# run as plain function
269270
def callback(**kwargs):
270-
cls.run(**kwargs)
271+
sys.exit(cls.run(**kwargs))
271272

272273
click_cmd = self.command_class(
273274
name=name,

0 commit comments

Comments
 (0)