def fetch_stage_or_default(stage_name=None, debug=False): if not stage_name: stage_name = shared.get_default_stage_name(debug=debug) if not shared.check_stage_file(stage_name): click.echo(click.style("Stage file '%s' not found." % stage_name, fg='red', bold=True)) return None stage = shared.get_stage_object(stage_name) return stage_name, stage
def create(stage_name): """Create new stage file""" if not stage_name: stage_name = shared.get_default_stage_name() if shared.check_stage_file(stage_name): click.echo(click.style("This stage name already exists. You can list " "them all with: `$ crmint stages list`", fg='red', bold=True)) exit(1) filepath = _create_stage_file(stage_name) click.echo(click.style("Stage file created: %s" % filepath, fg='green'))