Sha256: c83155b47960f492cde53e80b42cae5431fa3edbd85d8aba5e7d24d726c4ee35

Contents?: true

Size: 691 Bytes

Versions: 14

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

require_relative '../../command'
require 'fileutils'

module Dri
  module Commands
    class Rm
      class Profile < Dri::Command
        def initialize(options)
          @options = options
        end

        def execute(input: $stdin, output: $stdout)
          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
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dri-0.10.2 lib/dri/commands/rm/profile.rb
dri-0.10.1 lib/dri/commands/rm/profile.rb
dri-0.10.0 lib/dri/commands/rm/profile.rb
dri-0.9.0 lib/dri/commands/rm/profile.rb
dri-0.8.0 lib/dri/commands/rm/profile.rb
dri-0.7.0 lib/dri/commands/rm/profile.rb
dri-0.6.1 lib/dri/commands/rm/profile.rb
dri-0.6.0 lib/dri/commands/rm/profile.rb
dri-0.5.1 lib/dri/commands/rm/profile.rb
dri-0.5.0 lib/dri/commands/rm/profile.rb
dri-0.4.0 lib/dri/commands/rm/profile.rb
dri-0.3.1 lib/dri/commands/rm/profile.rb
dri-0.3.0 lib/dri/commands/rm/profile.rb
dri-0.2.0 lib/dri/commands/rm/profile.rb