1-join-leave: added
This commit is contained in:
@@ -8,6 +8,8 @@ module Release
|
||||
:create,
|
||||
:finish,
|
||||
:help,
|
||||
:join,
|
||||
:leave,
|
||||
:list,
|
||||
:start,
|
||||
:tab,
|
||||
|
||||
24
lib/release/join.rb
Normal file
24
lib/release/join.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require_relative './base'
|
||||
|
||||
module Release
|
||||
|
||||
class Join < Release::Base
|
||||
def valid?
|
||||
argv.size == 2
|
||||
end
|
||||
|
||||
def help
|
||||
"release join version"
|
||||
end
|
||||
|
||||
def execute
|
||||
subcommand, version = *argv
|
||||
|
||||
validate_current_branch_master
|
||||
git_pull current_branch
|
||||
|
||||
git_checkout_track release_branch_from_version(version)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
23
lib/release/leave.rb
Normal file
23
lib/release/leave.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
require_relative './base'
|
||||
|
||||
module Release
|
||||
|
||||
class Leave < Release::Base
|
||||
def valid?
|
||||
argv.size == 1
|
||||
end
|
||||
|
||||
def help
|
||||
"release leave"
|
||||
end
|
||||
|
||||
def execute
|
||||
validate_current_branch_is_release
|
||||
|
||||
git_checkout "master"
|
||||
|
||||
git_local_branch_trash current_branch
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -83,6 +83,10 @@ module Shared
|
||||
run_cmd "git checkout -b #{branch} #{commit}"
|
||||
end
|
||||
|
||||
def git_checkout_track (branch)
|
||||
run_cmd "git checkout --track origin/#{branch}"
|
||||
end
|
||||
|
||||
def git_commit (message, force = false)
|
||||
message = force ? message+' (no-verify)' : message
|
||||
message = '"' + message + '"'
|
||||
|
||||
Reference in New Issue
Block a user