bin/targit in targit-2.0.1 vs bin/targit in targit-2.0.2
- old
+ new
@@ -7,10 +7,11 @@
asset = Targit.new(file, repo, tag, options)
asset.upload!
puts "Successfully created asset! #{asset.url}"
end
+# rubocop:disable Metrics/BlockLength
Mercenary.program(:targit) do |p|
p.version Targit::VERSION
p.description 'Tool for adding GitHub release assets'
p.syntax 'targit [options] USER/REPO TAG /path/to/file'
@@ -26,16 +27,16 @@
p.action do |_, options|
repo, tag = ARGV.shift 2
if !repo || !tag
puts p
elsif !ARGV.empty?
- ARGV.each { |file| fail("#{file} not found") unless File.exist? file }
+ ARGV.each { |file| raise("#{file} not found") unless File.exist? file }
ARGV.each do |file|
puts "Adding #{file} on #{tag} of #{repo}"
upload file, repo, tag, options
end
elsif !STDIN.tty?
- fail('Name required if file is passed via STDIN') unless options[:name]
+ raise('Name required if file is passed via STDIN') unless options[:name]
upload STDIN, repo, tag, options
else
puts p
end
end