Sha256: 5fff75118926671a735f18ad2a72dce0e5e18129da69663c252d7e631ac9807d

Contents?: true

Size: 887 Bytes

Versions: 1

Compression:

Stored size: 887 Bytes

Contents

require 'json'
require 'fileutils'
require 'open3'
require 'arli'
require 'arli/commands/update'

module Arli
  module Commands
    class Install < Update

      def run
        header
        all_dependencies(command, 'name', 'git')
      end

      def install_dependency(name, url)
        cmd = if Dir.exist?(name)
                if update_if_exists
                  update_dependency(name)
                else
                  raise <<-EOF
               Existing folder found for library #{name.red}. 
               Please use -u switch with 'install' command, 
               or invoke the 'update' command directly."
                        EOF
                          .gsub(/^\s+/, '')

                end
              else
                "git clone -v #{url} #{name} 2>&1"
              end
        yield(cmd) if block_given?
        cmd
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arli-0.2.2 lib/arli/commands/install.rb