Sha256: ae8365ca75faebefbd91bb72af9c883c0428d469f04ac81fe612332ffbddc3ce

Contents?: true

Size: 951 Bytes

Versions: 5

Compression:

Stored size: 951 Bytes

Contents

#!/usr/bin/env ruby

require 'targit'
require 'mercenary'

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'

  # rubocop:disable Style/LineLength
  p.option :force, '-f', '--force', 'Replace the asset if it already exists'
  p.option :create, '-c', '--create', 'Create release if it does not exist'
  p.option :prerelease, '-p', '--prerelease', 'With -c, create as a dev release'
  p.option :authfile, '-a FILE', '--authfile FILE', 'Set the auth file for GitHub credentials'
  # rubocop:enable Style/LineLength

  p.action do |args, options|
    repo, tag, file = args
    if repo && tag && file
      puts "Attempting to upload #{file} on #{tag} of #{repo}"
      asset = Targit.new(file, repo, tag, options)
      asset.upload!
      puts "Successfully created asset! #{asset.url}"
    else
      puts p
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
targit-0.0.6 bin/targit
targit-0.0.5 bin/targit
targit-0.0.4 bin/targit
targit-0.0.3 bin/targit
targit-0.0.2 bin/targit