Sha256: cfbd126e2edebfc3ed6e500e6c7a515dc9e8dd8b1e03ea6620039636016a2e77
Contents?: true
Size: 778 Bytes
Versions: 14
Compression:
Stored size: 778 Bytes
Contents
require 'open3' module Kontena::Cli::Plugins class UninstallCommand < Clamp::Command include Kontena::Cli::Common parameter 'NAME', 'Plugin name' option "--force", :flag, "Force remove", default: false, attribute_name: :forced def execute confirm unless forced? uninstall_plugin(name) end def uninstall_plugin(name) plugin = "kontena-plugin-#{name}" gem_bin = `which gem`.strip install_command = "#{gem_bin} install -q #{plugin}" success = false ShellSpinner "Uninstalling plugin #{name.colorize(:cyan)}" do stdout, stderr, status = Open3.capture3(install_command) unless stderr.empty? raise stderr end end rescue => exc puts exc.message end end end
Version data entries
14 entries across 14 versions & 1 rubygems