Skip to content

Commit

Permalink
Update gem signing
Browse files Browse the repository at this point in the history
This way it generates fewer warnings.
  • Loading branch information
pointlessone committed Mar 5, 2024
1 parent a25adc8 commit acbc53b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ttfunk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Gem::Specification.new do |spec|
'rubygems_mfa_required' => 'true',
}

signing_key = File.expand_path('~/.gem/gem-private_key.pem')
if File.exist?(signing_key)
spec.cert_chain = ['certs/pointlessone.pem']
if $PROGRAM_NAME.end_with?('gem')
if File.basename($PROGRAM_NAME) == 'gem' && ARGV.include?('build')
signing_key = File.expand_path('~/.gem/gem-private_key.pem')
if File.exist?(signing_key)
spec.cert_chain = ['certs/pointlessone.pem']
spec.signing_key = signing_key
else
warn 'WARNING: Signing key is missing. The gem is not signed and its authenticity can not be verified.'
end
else
warn 'WARNING: Signing key is missing. The gem is not signed and its authenticity can not be verified.'
end

spec.authors = [
Expand Down

0 comments on commit acbc53b

Please sign in to comment.