autogitc 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/autogitc +6 -3
- data/lib/autogitc.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99784fe2ee80335aad903a67b88543706b6c3674de445406a69f268fca38a543
|
4
|
+
data.tar.gz: 8c107ed10ed3c4d0f6776a0ae09d2c76c1d3b2e77dee7b144704a037e8413b3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bd91f4c26f17dd0bf5414f47eba23f85f89d948b52843e4aad2daaf4fb0f527a39cc2504f66582760d3b3b70413db48b20f89a18dd13c4afb91e07c0f197e1c
|
7
|
+
data.tar.gz: 71abbc7d1dd108dfe140c183a828a1683e850488012fbda1f7ac408110c6e55683d7d5c54df30096ce3015e7baf70743cf1fbbf942417497128ac2cb6c314a7e
|
data/bin/autogitc
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
3
|
-
|
2
|
+
require 'bundler/setup'
|
3
|
+
require_relative '../lib/autogitc'
|
4
4
|
|
5
|
-
|
5
|
+
no_commit = ARGV.include?('--nocommit') || ARGV.include?('--nc')
|
6
|
+
|
7
|
+
puts 'Running autogitc...'
|
8
|
+
Autogitc.main(no_commit: no_commit)
|
data/lib/autogitc.rb
CHANGED
@@ -49,7 +49,7 @@ module Autogitc
|
|
49
49
|
JSON.parse(output_text)['commit_message']
|
50
50
|
end
|
51
51
|
|
52
|
-
def self.main
|
52
|
+
def self.main(no_commit: false)
|
53
53
|
if openai_api_key.nil?
|
54
54
|
puts 'No AUTOGITC_KEY key found in environment variables.'
|
55
55
|
return
|
@@ -68,8 +68,9 @@ module Autogitc
|
|
68
68
|
end.join("\n")
|
69
69
|
|
70
70
|
commit_message = generate_commit_message(changes_summary)
|
71
|
-
puts
|
71
|
+
puts 'Generated commit message:'
|
72
|
+
puts commit_message
|
72
73
|
|
73
|
-
`git commit -m "#{commit_message}"`
|
74
|
+
`git commit -m "#{commit_message}"` unless no_commit
|
74
75
|
end
|
75
76
|
end
|