aboutsummaryrefslogtreecommitdiffstats
path: root/task
diff options
context:
space:
mode:
authorRoy Sommer <illBeRoy@users.noreply.github.com>2020-02-01 17:11:46 +0200
committerGitHub <noreply@github.com>2020-02-01 17:11:46 +0200
commitf6248d4521a4a23d58137058cd400af4fef33af7 (patch)
treef667db8e7db80755e349bc456f5e65d1f4edb620 /task
parentrenamed hooks dir (diff)
downloadtaskipy2-f6248d4521a4a23d58137058cd400af4fef33af7.zip
Ignore SIGINT While Running Tasks (#8)
fix: sigint is now ignored by taskipy process, reflects output of task instead
Diffstat (limited to '')
-rw-r--r--taskipy/run.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/taskipy/run.py b/taskipy/run.py
index 014d0ae..ab7824d 100644
--- a/taskipy/run.py
+++ b/taskipy/run.py
@@ -9,7 +9,12 @@ def run_task(task_name: str, args: List[str], cwd=os.curdir):
def run_commands_and_bail_on_first_fail(cmds: List[str]) -> int:
for cmd in cmds:
p = subprocess.Popen(cmd, shell=True, cwd=cwd)
- p.wait()
+
+ try:
+ p.wait()
+ except KeyboardInterrupt:
+ pass
+
if p.returncode != 0:
return p.returncode
@@ -22,7 +27,6 @@ def run_task(task_name: str, args: List[str], cwd=os.curdir):
sys.exit(1)
except toml.TomlDecodeError:
print('pyproject.toml file is malformed and could not be read')
- # should print exception details
sys.exit(1)
try: