pull-request 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/pr +15 -2
- data/pullrequest.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47ba8b480d14f0f71f0042798a035228d44c4d9bf7f446555f4af5f092b0747c
|
4
|
+
data.tar.gz: d33393ceb042ef7c29625712902252091c38b38986dfbe9ddc9b64effc35d7d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed68a9afa54c9a0bccde8b6b28a6fa75b506d28e0ca1d8ae3664a1e0b6f7aaab5357c6781bf6f9c55ab7f38a2d72f92ce3b9a5bc0dbb6157f0c9df971c35d899
|
7
|
+
data.tar.gz: ae80c14c3c83c29b03175d237c0f7856b3b00fd8488dc33bbcdf9191fb7fbcf8c89535ccfb435537896d906df5e88db98775ffdadd4d01fcc13b837d49033bfe
|
data/exe/pr
CHANGED
@@ -12,6 +12,12 @@ def error(title)
|
|
12
12
|
exit 1
|
13
13
|
end
|
14
14
|
|
15
|
+
def confirm(title)
|
16
|
+
printf "#{title}\npress 'y' to continue: "
|
17
|
+
prompt = STDIN.gets.chomp
|
18
|
+
prompt == 'y'
|
19
|
+
end
|
20
|
+
|
15
21
|
def sh(command)
|
16
22
|
return puts "▶️ #{command}" if @simulate
|
17
23
|
|
@@ -22,7 +28,11 @@ def sh_get(command)
|
|
22
28
|
value = `#{command}`
|
23
29
|
error "could not execute '#{command}'" unless $? == 0
|
24
30
|
|
25
|
-
value
|
31
|
+
value.strip
|
32
|
+
end
|
33
|
+
|
34
|
+
def current_branch
|
35
|
+
sh_get "git rev-parse --abbrev-ref HEAD"
|
26
36
|
end
|
27
37
|
|
28
38
|
OptionParser.new do |opts|
|
@@ -53,6 +63,9 @@ title += "\n\nfixes ##{@issue_number}" if @issue_number
|
|
53
63
|
branch = "feature/"
|
54
64
|
branch += "#{@issue_number}_" if @issue_number
|
55
65
|
branch += name.parameterize.underscore
|
66
|
+
base_branch = current_branch
|
67
|
+
|
68
|
+
exit 1 unless ["master", "main", "develop"].include?(base_branch) || confirm("Your base branch #{base_branch} doesn't seem to be a common base branch name. Do you want to continue?")
|
56
69
|
|
57
70
|
puts "Creating new PR for feature '#{title}'"
|
58
71
|
|
@@ -66,4 +79,4 @@ puts "Pushing to origin"
|
|
66
79
|
sh "git push -u origin #{branch}"
|
67
80
|
|
68
81
|
puts "Creating pull request"
|
69
|
-
sh "hub pull-request -d -m '#{title}'"
|
82
|
+
sh "hub pull-request -d -m '#{title}' -b #{base_branch}"
|
data/pullrequest.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pull-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Ravens
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|