lib/kpm/inspector.rb in kpm-0.10.2 vs lib/kpm/inspector.rb in kpm-0.10.3

- old
+ new

@@ -73,10 +73,17 @@ def build_plugin_map(plugin_name, plugin_path, type) plugin_map = { plugin_name: plugin_name, plugin_path: plugin_path.to_s, type: type } entries = get_entries(plugin_path) set_default = entries.select { |e| e == 'SET_DEFAULT' }[0] - default_version = File.basename(File.readlink(plugin_path.join(set_default))) if set_default + default_version = nil + if set_default + begin + default_version = File.basename(File.readlink(plugin_path.join(set_default))) + rescue StandardError + # On Windows, SET_DEFAULT is a directory, not a symbolic link + end + end non_default = entries.reject do |e| e == 'SET_DEFAULT' end versions = non_default.each_with_object([]) do |e, out|