Class: Dri::Commands::Rm::Profile

Inherits:
Dri::Command show all
Defined in:
lib/dri/commands/rm/profile.rb

Instance Method Summary collapse

Methods inherited from Dri::Command

#add_color, #api_client, #bold, #command, #config, #cursor, #editor, #emoji, #handover_report_path, #logger, #ops_token, #pastel, #profile, #prompt, #spinner, #timezone, #token, #username, #verify_config_exists

Constructor Details

#initialize(options) ⇒ Profile

Returns a new instance of Profile.



10
11
12
# File 'lib/dri/commands/rm/profile.rb', line 10

def initialize(options)
  @options = options
end

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dri/commands/rm/profile.rb', line 14

def execute(*)
  verify_config_exists

  remove = prompt.yes? "Are you sure you want to remove existing profile?"

  unless remove
    logger.info "Profile kept in place 👍"
    exit 0
  end

  logger.info "Removing profile..."

  FileUtils.rm("#{Dir.pwd}/.dri_profile.yml")

  logger.success "Done ✅"
end