gdotdesign/elm-github-install

View on GitHub
bin/elm-install

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

require 'rubygems'
require 'commander/import'
require 'elm_install'

program :name, 'elm-install'
program :version, ElmInstall::VERSION
program :description, 'Install Elm packages from Git repositories.'

command :install do |c|
  c.syntax = 'elm-install install'
  c.summary = 'Install Elm packages from the elm-package.json file.'
  c.option '--cache-directory STRING', String,
           'Specifies where the cache is stored'
  c.option '--skip-update', 'Skips the update stage of packages'
  c.option '--only-update STRING', 'Only updates the given package'
  c.option '--verbose'
  c.action do |_args, options|
    ElmInstall.install(
      verbose: options.verbose,
      skip_update: options.skip_update,
      only_update: options.only_update,
      cache_directory: options.cache_directory ||
                       File.join(Dir.home, '.elm-install')
    )
  end
end

default_command :install