lib/arli/commands/install.rb in arli-1.0.2 vs lib/arli/commands/install.rb in arli-1.1.0

- old
+ new

@@ -28,31 +28,35 @@ self.library = identify_library(install_argument) raise Arli::Errors::LibraryNotFound, "Library #{cfg.to_hash} was not found" unless library - self.arlifile = Arli::ArliFile.new(config: config, libraries: [ library ]) + self.arlifile = Arli::ArliFile.new(config: config, libraries: [library]) if config.trace info("found library using #{install_method}:\n#{library.inspect}") end end + def additional_info + "\nInstalling: #{runtime.argv.join(' ').bold.green}\n" + end + def run arlifile.install end # arg can be 'Adafruit GFX Library' def identify_library(arg) results = if arg =~ %r[https?://]i self.install_method = :url - r = search(url: /^#{arg}$/i) + r = search(url: /^#{arg}$/i) if r.empty? self.install_method = :website - r = search(website: /^#{arg}$/i) + r = search(website: /^#{arg}$/i) end if r.empty? self.install_method = :custom - r = [ Arduino::Library::Model.from_hash(url: arg, name: File.basename(arg)) ] + r = [Arduino::Library::Model.from_hash(url: arg, name: File.basename(arg))] end r elsif File.exist?(arg) || arg =~ /\.zip$/ self.install_method = :archiveFileName search(archiveFileName: "#{File.basename(arg)}")