Skip to content

Commit

Permalink
fail() helper added to rituals.easy
Browse files Browse the repository at this point in the history
  • Loading branch information
jhermann committed Jun 22, 2016
1 parent 6a6e457 commit 3b078b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rituals/easy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from __future__ import absolute_import, unicode_literals, print_function

import os
import sys

from invoke import Collection, ctask as task

Expand Down Expand Up @@ -60,7 +61,14 @@
namespace.add_collection(_)


__all__ = ['Collection', 'task', 'namespace', 'pushd']
def fail(message, exitcode=1):
"""Exit with error code and message."""
sys.stderr.write('ERROR: {}\n'.format(message))
sys.stderr.flush()
sys.exit(exitcode)


__all__ = ['Collection', 'task', 'namespace', 'pushd', 'fail']

for _ in namespace.task_names:
_name = _.replace('-', '_').replace('.', '_')
Expand Down

0 comments on commit 3b078b0

Please sign in to comment.