Sha256: 555432a69eb1a3f4d9ae66270f4b8ab7aec1b74bc4d7dbf80738813f62e02f35
Contents?: true
Size: 802 Bytes
Versions: 33
Compression:
Stored size: 802 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 confirm unless forced? uninstall_plugin(name) end def uninstall_plugin(name) plugin = "kontena-plugin-#{name}" gem_bin = which('gem') uninstall_command = "#{gem_bin} uninstall -q #{plugin}" success = false spinner "Uninstalling plugin #{name.colorize(:cyan)}" do stdout, stderr, status = Open3.capture3(uninstall_command) unless stderr.empty? raise stderr end end rescue => exc puts exc.message end end end
Version data entries
33 entries across 33 versions & 1 rubygems