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, #cursor, #editor, #pastel, #prompt, #spinner, #verify_config_exists

Methods included from Utils::Helpers

logger

Constructor Details

#initialize(options) ⇒ Profile

Returns a new instance of Profile.



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

def initialize(options)
  @options = options
end

Instance Method Details

#executeObject



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

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