Sha256: dbfcfc048df84b70b975e30796cc35798788da670cfd7dc0e9849dcb2e29969f
Contents?: true
Size: 1.05 KB
Versions: 13
Compression:
Stored size: 1.05 KB
Contents
require 'karo/common' require 'thor' require 'grit' module Karo class Workflow < Thor include Karo::Common desc "feature", "create a feature branch for a given name" def feature(name) branch_name = "feature/#{name}" if current_branch.eql?(branch_name) say "You are already on #{branch_name} this feature branch", :red elsif branch_exists? branch_name say "Feature branch #{branch_name} already exists! so checking it out", :red checkout_branch branch_name else create_and_checkout_branch branch_name end end desc "bugfix", "create a bug fix branch for a given name" def bugfix(name) branch_name = "bugfix/#{name}" if current_branch.eql?(branch_name) say "You are already on #{branch_name} this bug fix branch", :red elsif branch_exists? branch_name say "Bug fix branch #{branch_name} already exists! so checking it out", :red checkout_branch branch_name else create_and_checkout_branch branch_name end end end end
Version data entries
13 entries across 13 versions & 1 rubygems