Method: NexusAPI::CLIUtils#if_file_exists?

Defined in:
lib/nexus_api/cli_utils.rb

#if_file_exists?(file: , repository: ) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
# File 'lib/nexus_api/cli_utils.rb', line 55

def if_file_exists?(file: options[:filename], repository: options[:repository])
  begin
    puts "Sending '#{file}' to the '#{repository}' repository in Nexus!"
    yield
  rescue Errno::ENOENT
    puts "'#{file}' does not exist locally."
  end
end