Method: Milkode::Cdstk#remove

Defined in:
lib/milkode/cdstk/cdstk.rb

#remove(args, options) ⇒ Object



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/milkode/cdstk/cdstk.rb', line 355

def remove(args, options)
  update_display_info(options)
  
  if (options[:all])
    remove_all
  else
    print_result do
      db_open
      args.each do |arg|
        package = @yaml.find_name(arg) || @yaml.find_dir(arg)

        unless package
          path = File.expand_path(arg)
          package = @yaml.package_root(path) if File.exist?(path)
        end
        
        if (package)
          remove_dir(package.directory)                
        else
          @out.puts "Not found package '#{arg}'."
          return
        end
      end
    end
  end
end