Sha256: f3deb1ecadf64e612f0a71207b664ee0ca234b2a679118ca92f834f372a78420

Contents?: true

Size: 804 Bytes

Versions: 1

Compression:

Stored size: 804 Bytes

Contents

#!/usr/bin/env ruby

require 'dotenv/load'
require 'thor'
require 'json'

require_relative '../lib/licensee'

class LicenseeCLI < Thor
  package_name 'Licensee'
  class_option :remote, type: :boolean, desc: 'Assume PATH is a GitHub owner/repo path'
  default_task :detect

  private

  def path
    @path ||= if !options[:remote] || args.first =~ %r{^https://}
      args.first || Dir.pwd
    else
      "https://github.com/#{args.first}"
    end
  end

  def project
    @project ||= Licensee.project(path,
                                  detect_packages: options[:packages], detect_readme: options[:readme])
  end

  def remote?
    path =~ %r{^https://}
  end
end

commands_dir = File.expand_path 'lib/licensee/commands/'
Dir["#{commands_dir}/*.rb"].each { |c| require(c) }

LicenseeCLI.start(ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
licensee-9.9.0.beta.2 bin/licensee