From acbc53bea7b4123c813bd78f681ea3e76f9de9f6 Mon Sep 17 00:00:00 2001 From: Alexander Mankuta Date: Tue, 5 Mar 2024 11:07:09 +0200 Subject: [PATCH] Update gem signing This way it generates fewer warnings. --- ttfunk.gemspec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ttfunk.gemspec b/ttfunk.gemspec index b034a10..ce4d6a6 100644 --- a/ttfunk.gemspec +++ b/ttfunk.gemspec @@ -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 = [