pr-with-params 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -2
- data/Gemfile.lock +1 -1
- data/exe/pr-with-params +6 -3
- data/lib/pr/with/params/version.rb +1 -1
- data/lib/pr/with/params.rb +3 -5
- 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: 205374a47996232c17343492935e3fb4a66ced497e2c0dbf2bbfce278e67a9de
|
4
|
+
data.tar.gz: 3d5a35b0957a4c9b101756164d39a2bfdf85cb98b1e9d30795ba21a814f06046
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8efbfa3dcb16a892718c9e60b0a6093512b05c4226b7ecd990ba7aa46b99368ad7c9b944a02949a704fa583a56173ef21b9c5c269bd3f36fc899452202f3434f
|
7
|
+
data.tar.gz: 4b21a5705d4e3bfa8046a020656ffc25d92c4466652e213074bcd0fbb08b092d53fe9939905dfebeee6ea3e862a0efe0404c7ce19b8ebf0203833f919f1d122e
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/exe/pr-with-params
CHANGED
@@ -39,7 +39,7 @@ parser = OptionParser.new do |opt|
|
|
39
39
|
options[:template] = pr_template
|
40
40
|
end
|
41
41
|
|
42
|
-
opt.on('-d', '--description DESC', 'Specify a custom PR title') do |pr_description|
|
42
|
+
opt.on('-d', '--description DESC', 'Specify a custom PR title. Will use the first branch commit message otherwise.') do |pr_description|
|
43
43
|
options[:title] = pr_description
|
44
44
|
end
|
45
45
|
|
@@ -60,8 +60,11 @@ begin
|
|
60
60
|
|
61
61
|
branch_name = `git rev-parse --abbrev-ref HEAD`.chomp
|
62
62
|
base_branch = options.delete(:base_branch) || `git remote show origin | grep "HEAD branch" | sed 's/.*: //'`.chomp
|
63
|
-
remote_git_uri = `git config --get remote.origin.url`.sub('git@github.com:', '').sub('.git', '').chomp
|
64
63
|
|
64
|
+
default_title = `git show-branch --no-name $(git log #{base_branch}..#{branch_name} --pretty=format:"%h" | tail -1)`.chomp
|
65
|
+
options[:title] ||= default_title
|
66
|
+
|
67
|
+
remote_git_uri = `git config --get remote.origin.url`.sub('git@github.com:', '').sub('.git', '').chomp
|
65
68
|
uri_host = 'www.github.com'
|
66
69
|
uri_path = "/#{remote_git_uri}/compare/#{base_branch}...#{branch_name}"
|
67
70
|
|
@@ -85,6 +88,6 @@ rescue StandardError => e
|
|
85
88
|
backtrace: e.backtrace&.last(10)
|
86
89
|
}.to_json
|
87
90
|
|
88
|
-
|
91
|
+
warn "\e[31mERROR\e[0m: " + error_message + "\n"
|
89
92
|
exit 1
|
90
93
|
end
|
data/lib/pr/with/params.rb
CHANGED
@@ -20,9 +20,7 @@ module PR
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def parse_config(file_path, scope)
|
23
|
-
|
24
|
-
|
25
|
-
ConfigParser.new(config_file_path: file_path, scope: scope).parse!
|
23
|
+
file_path.empty? ? {} : ConfigParser.new(config_file_path: file_path, scope: scope).parse!
|
26
24
|
rescue StandardError => e
|
27
25
|
error_message = {
|
28
26
|
message: "Error parsing config file. Using defaults",
|
@@ -30,8 +28,8 @@ module PR
|
|
30
28
|
backtrace: e.backtrace&.last(10)
|
31
29
|
}.to_json
|
32
30
|
|
33
|
-
|
34
|
-
|
31
|
+
warn "\e[35mWARNING\e[0m: " + error_message + "\n"
|
32
|
+
|
35
33
|
{}
|
36
34
|
end
|
37
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pr-with-params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 2k-joker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|