1-join-leave: added
This commit is contained in:
@@ -8,6 +8,8 @@ module Release
|
|||||||
:create,
|
:create,
|
||||||
:finish,
|
:finish,
|
||||||
:help,
|
:help,
|
||||||
|
:join,
|
||||||
|
:leave,
|
||||||
:list,
|
:list,
|
||||||
:start,
|
:start,
|
||||||
:tab,
|
: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}"
|
run_cmd "git checkout -b #{branch} #{commit}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def git_checkout_track (branch)
|
||||||
|
run_cmd "git checkout --track origin/#{branch}"
|
||||||
|
end
|
||||||
|
|
||||||
def git_commit (message, force = false)
|
def git_commit (message, force = false)
|
||||||
message = force ? message+' (no-verify)' : message
|
message = force ? message+' (no-verify)' : message
|
||||||
message = '"' + message + '"'
|
message = '"' + message + '"'
|
||||||
|
|||||||
Reference in New Issue
Block a user