11import subprocess
2- from typing import Optional , List , Tuple
2+ from typing import Optional , Tuple
33
44import typer
55from rich import print
66
77import taskbadger as tb
8- from taskbadger import Action
9- from taskbadger import integrations
8+ from taskbadger import Action , integrations
109from taskbadger .config import get_config , write_config
1110from taskbadger .exceptions import ConfigurationError
1211
@@ -24,12 +23,16 @@ def _configure_api(ctx):
2423
2524@app .command (context_settings = {"allow_extra_args" : True , "ignore_unknown_options" : True })
2625def monitor (
27- ctx : typer .Context ,
28- name : str ,
29- action_def : Tuple [str , integrations .Integrations , str ] = typer .Option (
30- (None , None , None ), "--action" , "-a" , metavar = "<trigger integration config>" , show_default = False ,
31- help = "Action definition e.g. \" success,error email to:me@email.com\" "
32- )
26+ ctx : typer .Context ,
27+ name : str ,
28+ action_def : Tuple [str , integrations .Integrations , str ] = typer .Option (
29+ (None , None , None ),
30+ "--action" ,
31+ "-a" ,
32+ metavar = "<trigger integration config>" ,
33+ show_default = False ,
34+ help = 'Action definition e.g. "success,error email to:me@email.com"' ,
35+ ),
3336):
3437 """Monitor a command"""
3538 _configure_api (ctx )
@@ -43,7 +46,7 @@ def monitor(
4346 except Exception as e :
4447 task .error (data = {"exception" : str (e )})
4548 raise typer .Exit (1 )
46-
49+
4750 if result .returncode == 0 :
4851 task .success ()
4952 else :
0 commit comments