File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,16 @@ def setup(user_host)
4343 option "ssh-key-path" , type : :string , banner : "Auth using ssh key"
4444 option "repo-url" , type : :string , banner : "Repo url"
4545 option "repo-key-path" , type : :string , banner : "SSH key for a git repo"
46+ option "skip-check" , type : :boolean , default : false , banner : "Skip git repository checks"
4647 def deploy ( user_host )
47- if !`git status --short` . empty?
48- raise "Deploy: Please commit your changes first"
49- elsif `git remote` . empty?
50- raise "Deploy: Please add remote origin repository to your repo first"
51- elsif !`git rev-list master...origin/master` . empty?
52- raise "Deploy: Please push your commits to the remote origin repo first"
48+ unless options [ "skip-check" ]
49+ if !`git status --short` . empty?
50+ raise "Deploy: Please commit your changes first"
51+ elsif `git remote` . empty?
52+ raise "Deploy: Please add remote origin repository to your repo first"
53+ elsif !`git rev-list master...origin/master` . empty?
54+ raise "Deploy: Please push your commits to the remote origin repo first"
55+ end
5356 end
5457
5558 repo_url = options [ "repo-url" ] ? options [ "repo-url" ] : `git remote get-url origin` . strip
You can’t perform that action at this time.
0 commit comments