Shrikant Sharat Kandula committed f709994

Added "force clone" option to force cloning instead of pulling

Comments (0)

Files changed (2)

 And this will cause the pathogen plugin to be cloned to `bundle/super-plugin` instead of
+If, for some reason, you don't want to pull/fetch, but clone every time instead, you can
+add `force clone` to the end of the bundle line. This is useful, if you are messing up
+the plugin's directory using the commands in `Run` directives, described below.
 And of course, you can have a line with both the `with` and the `to` options, along with
 any other that might be added in the future ;).
             dest_dir = dest_dir[:-(1 + len(vcs))]
         self.dest_dir = dest_dir
+        # Check if requesting force clone
+        self.force_clone = ' force clone' in arg
+        if self.force_clone:
+            sh.rmtree(self.dest_dir)
+        # Detect if any subdirectory contains the vim plugin
+        subdir_match ='only\s+"(.+?)"', arg)
+        self.subdir = if subdir_match else None
         if vcs is not None:
             print ('!' if self.is_bang else '-') * 20, self.dest_dir
             getattr(self, '_vcs_' + vcs)()
     def _vcs_hg(self):
         self.cmds.insert(0, 'hg ' + ('pull' if os.path.exists(self.dest_dir) else 'clone ' + self.url))
+        #self.cmds += ['mv "' + self.subdir + '" /tmp/_vimpire_tmp', 'rm ]
     def _vcs_git(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.