hariton / pathogenized

Ruby-script for updating vim-plugins (based on pathogen.vim by Tim Pope)
4 stars 0 forks source link

Add plugins not available from either vim.org or Git repository #1

Open joelpet opened 14 years ago

joelpet commented 14 years ago

I would like to be able to add plugins that are available neither from vim.org nor from a public Git repository. For example, the latest versions of Vim-Latex is only available (?) from http://sourceforge.net/projects/vim-latex.

I have some suggestions on how to achieve this.

  1. Add a plugin key external (or something like that) that works just like plugin.has_key?('vim_org_id') but instead contains the full URI of the file.
  2. Let the user add the plugin manually, and then do not FileUtils.rm_rf each bundle directory. Instead, just remove the contents of a directory if a new version is found.
  3. Add a manual plugin config type. Let the user add the plugin manually. Then only do FileUtils.rm_rf on directories that are not specified as manual in the config file.
  4. Add sourceforge as a plugin config alternative similar to 'vim_org_id'.

Unfortunately, I'm not very familiar with Ruby, which is why I haven't forked and patched your great script.

joelpet commented 14 years ago

I ended up with the following very simple patch that is however not optimal:

--- a/bin/update_plugins
+++ b/bin/update_plugins
@@ -23,10 +23,10 @@ end

 FileUtils.mkdir_p(bundles_dir) unless File.exist?(bundles_dir)
 FileUtils.cd(bundles_dir)
-Dir['*'].each {|d| FileUtils.rm_rf d}

 config.each do |plugin|
   name, dir = plugin['names'].first, plugin['dir']
+  FileUtils.rm_rf Dir[dir]
   if plugin.has_key?('repo') && plugin['repo'] =~ /^git:\/\/.*\.git$/
     puts "  Unpacking #{name} into #{dir}"
     `git clone #{plugin['repo']} #{dir}`
hariton commented 14 years ago

Thanks, Joel! Your ideas are very nice. At the weekend I will have a free moment, I'll see what can be done.