autogitc 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/autogitc +3 -1
  3. data/lib/autogitc.rb +4 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70b587912c12f437a8ca1cd98093680920df43c9633af60648e9484e4aab1a6c
4
- data.tar.gz: 343bee76fd891b344208493bc9b6e2a798d86d8a94b77e56c6eec07b871d1ad9
3
+ metadata.gz: 99784fe2ee80335aad903a67b88543706b6c3674de445406a69f268fca38a543
4
+ data.tar.gz: 8c107ed10ed3c4d0f6776a0ae09d2c76c1d3b2e77dee7b144704a037e8413b3b
5
5
  SHA512:
6
- metadata.gz: d65c18d727898e03938a5445cd3f1839b89b710e354eddc7b2cb2a8362ba036012461a17434a42bae1cd9c525fcff09d594c765b02a5301a02c38570475e8f47
7
- data.tar.gz: bb0e40f88bcb44d2455eca7a80b92a6805efe54a309e912bbdb4cc3023257d65a71d890d64592b592d9fb0a9bae4600718c9a4a1ddd2f4e9818e1535710c73c3
6
+ metadata.gz: 3bd91f4c26f17dd0bf5414f47eba23f85f89d948b52843e4aad2daaf4fb0f527a39cc2504f66582760d3b3b70413db48b20f89a18dd13c4afb91e07c0f197e1c
7
+ data.tar.gz: 71abbc7d1dd108dfe140c183a828a1683e850488012fbda1f7ac408110c6e55683d7d5c54df30096ce3015e7baf70743cf1fbbf942417497128ac2cb6c314a7e
data/bin/autogitc CHANGED
@@ -2,5 +2,7 @@
2
2
  require 'bundler/setup'
3
3
  require_relative '../lib/autogitc'
4
4
 
5
+ no_commit = ARGV.include?('--nocommit') || ARGV.include?('--nc')
6
+
5
7
  puts 'Running autogitc...'
6
- Autogitc.main
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 "Generated commit message:\n#{commit_message}"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autogitc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Goh