Sha256: 2e04c98a171e5b9ea0fb009e2b102f9b475404fd7fddfcc670d89079cb173297

Contents?: true

Size: 870 Bytes

Versions: 32

Compression:

Stored size: 870 Bytes

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module Prompt
  def prompt_to_continue(command, destination = 'local')
    puts "The following rsync command will be executed to update the #{destination} copy of the specs:"
    puts
    puts command
    puts
    puts "CAUTION: Any unsaved changes that exist within the #{destination} content will be OVERWRITTEN!"
    if destination.eql?('local')
      puts 'CAUTION 2: Before continuing, make sure your local repo is on the correct, synced branch!'
    end
    puts
    print "Do you wish to continue? ('y' to continue, return to cancel) [n] "
    continue = STDIN.gets.chomp
    if continue.casecmp('y') == 0
      system(command)
    else
      puts 'Cancelled'
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.16.1 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.16.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.15.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.14.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.13.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.12.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.11.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.10.2 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.10.1 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.10.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.9.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.8.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.7.1 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.7.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.6.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.5.0 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.4.2 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.4.1 lib/tasks/helpers/prompt.rb
newrelic_rpm-9.4.0 lib/tasks/helpers/prompt.rb