Skip to content

initial stab at BundleCommand#97

Open
bronson wants to merge 1 commit intoVundleVim:masterfrom
bronson:master
Open

initial stab at BundleCommand#97
bronson wants to merge 1 commit intoVundleVim:masterfrom
bronson:master

Conversation

@bronson
Copy link
Copy Markdown

@bronson bronson commented Oct 13, 2011

This almost works... All BundleCommands run every time Vim starts, not just after bundles have been installed. Running every time Vim starts would be far too slow.

Any idea how to solve this?

Originally I thought BundleCommand should be associated with the previous Bundle and only run if the bundle it's associated with is updated. So, for example...

Bundle 'git://git.wincent.com/command-t.git'
# ensure we compile with system Ruby
BundleCommand 'cd command-t && if which rvm >/dev/null 2>&1; then rvm system exec rake make; else rake make; fi'

When command-t gets updated, the BundleCommand would be run.

Now I'm thinking that's too complex, and all BundleCommands should be run after any plugin(s) are installed. Easier to code, easier to understand.

@bronson
Copy link
Copy Markdown
Author

bronson commented Oct 15, 2011

I simplified BundleCommand in vim-update-bundles: bronson/vim-update-bundles@0066edb

Now, if we can figure out how to make the BundleCommands run when bundles are installed, not when Vim starts, this will be finished. Any ideas?

@gmarik
Copy link
Copy Markdown
Contributor

gmarik commented Oct 15, 2011

Scott, i'll make it run only on BundleInstall, hopefully tomorrow

@gmarik
Copy link
Copy Markdown
Contributor

gmarik commented Oct 17, 2011

Scott, check BundleMake
It's in own BundleMake branch for now.
Unstable!

@bronson
Copy link
Copy Markdown
Author

bronson commented Oct 18, 2011

That seems awfully complex... Not sure I'd care to write that by hand.

Also, you're probably not expecting vim-update-bundles to share this syntax?

@gmarik
Copy link
Copy Markdown
Contributor

gmarik commented Oct 18, 2011

You mean the

:ruby puts( cmd = "cd #{File.expand_path($LOAD_PATH.grep(/command-?t/i).first)}/command-t/ && git checkout -f master && ruby extconf.rb && make clean && make");
      \ system(cmd)

is overly complex?
Yeah, cuz i just took what I've been using myself.
Also it's "smart" enough to not care about working directory(which probably is broken)

Oh, that's right it's incompatible...(

 cd command-t && if which rvm >/dev/null 2>&1; then rvm system exec rake make; else rake make; fi

should work aswell, but requires leading !, and full path:

 !cd ~/.vim/bundle/command-t && if which rvm >/dev/null 2>&1; then rvm system exec rake make; else rake make; fi

It was a quick hack(proove of concept), that's why didn't pay enough attention for details

@bronson
Copy link
Copy Markdown
Author

bronson commented Oct 18, 2011

Ah, that whole first half is just searching the load path for command-t. Not as bad as I originally thought (was distracted when reading it). Will there ever be a situation where it isn't in ~/.vim/bundle/command-t?

I figured the script should cd ~/.vim/bundle before execing the command since most scripts will want that anyway and there's no sane reason for the .vimrc to know the cwd.

Curious why you git checkout master... is there a Vundle feature that changes the branch?

@gmarik
Copy link
Copy Markdown
Contributor

gmarik commented Oct 18, 2011

Curious why you git checkout master... is there a Vundle feature that changes the branch?

The actual build script doesn't actually matter, as long as it's doing its job so i'll use your version.
Sorry for confusing you...

Also sorry for naming it BundleMake wast't paying enough attention, again! )
Will fix those..

@bronson
Copy link
Copy Markdown
Author

bronson commented Oct 18, 2011

BundleMake is a decent name but implies that it needs a Makefile... I could go for BundleExec. BundleCommand is so long to type.

Pretty soon it's going to be PluginExec, eh? :)

@MarcWeber
Copy link
Copy Markdown

Please provide status update or close

@davidlowryduda
Copy link
Copy Markdown

This pull request is now stale, and should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants