Sha256: 6d1dd874404d4e505cc5b5074754ff1415a1e38ee0b51b12731c8c2679492576

Contents?: true

Size: 816 Bytes

Versions: 34

Compression:

Stored size: 816 Bytes

Contents

require 'kontena/plugin_manager'

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

    parameter 'NAME ...', 'Plugin name'

    def execute
      name_list.each do |name|
        exit_with_error "Plugin #{name} has not been installed" unless plugin_installed?(name)
        spinner "Uninstalling plugin #{pastel.cyan(name)}" do
          plugin_uninstaller(name).uninstall
        end
      end
    end

    # @param name [String]
    # @return [Boolean]
    def plugin_installed?(name)
      Kontena::PluginManager::Common.installed?(name)
    end

    # @param name [String]
    # @return [Kontena::PluginManager::Uninstaller]
    def plugin_uninstaller(name)
      Kontena::PluginManager::Uninstaller.new(name)
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.10 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.9 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.8 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.7 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.6 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.5 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.4 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.3 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.2 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.1 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.7.0 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.9 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.8 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.7 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.6 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.5 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.4 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.3 lib/kontena/cli/plugins/uninstall_command.rb
krates-1.6.2 lib/kontena/cli/plugins/uninstall_command.rb