Sha256: 823d848e94ba26fafd6f28eca31ebcac779700ab211e89bbb9a256ea2d433ec1

Contents?: true

Size: 788 Bytes

Versions: 18

Compression:

Stored size: 788 Bytes

Contents

require 'open3'

module Kontena::Cli::Plugins
  class UninstallCommand < Kontena::Command
    include Kontena::Util
    include Kontena::Cli::Common

    parameter 'NAME', 'Plugin name'

    option "--force", :flag, "Force remove", default: false, attribute_name: :forced

    def execute
      exit_with_error "Plugin #{pastel.cyan(name)} is not installed" unless Kontena::PluginManager.instance.installed(name) && !ENV['NO_PLUGINS']
      confirm unless forced?
      spinner "Uninstalling plugin #{pastel.cyan(name)}" do |spin|
        begin
          Kontena::PluginManager.instance.uninstall_plugin(name)
        rescue => ex
          $stderr.puts pastel.red("#{ex.class.name} : #{ex.message}")
          logger.error(ex)
          spin.fail
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
kontena-cli-1.3.5 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.4.0.pre1 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.4 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.3 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.3.rc1 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.2 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.2.rc2 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.2.rc1 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.1 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.1.rc2 lib/kontena/cli/plugins/uninstall_command.rb
kontena-cli-1.3.1.rc1 lib/kontena/cli/plugins/uninstall_command.rb