Class: GitUnpublish

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/git-unpublish.rb

Instance Method Summary collapse

Methods included from Helpers

#init

Instance Method Details

#runObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/git-unpublish.rb', line 5

def run
  init(ARGV[0], ARGV[1])
  DANGER = %w[test development master dev develop staging production]
  if DANGER.include? @remote_branch_name
    puts "It looks like you are trying to delete an important branch. Are you sure you want to continue?"
    puts "type \"delete #{@remote_branch_name}\" (without quotes) to continue."
    continue = gets.strip
    if contunue != "delete #{@remote_branch_name}"
      puts "aborting"
    else
      %x|git push #{@origin} :#{@remote_branch_name}|
      puts %Q|\n  Run \`git branch -d #{@local_branch_name}\` to delete the branch locally\n |
    end
  end
end