# Script/plugin install vs git submodule add

**URL:** <https://www.ruby-forum.com/t/script-plugin-install-vs-git-submodule-add/174746>\
**Category:** Rails\
**Created:** [September 1, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/script-plugin-install-vs-git-submodule-add/174746 "2009-09-01T16:02:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [September 1, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/script-plugin-install-vs-git-submodule-add/174746/1 "2009-09-01T16:02:10Z")

</div>

I’ve found several web pages that describe how to use git submodules  
to install plugins, but it seems that those pages are missing  
something (or more likely, I am) .

In a nutshell, they advise replacing

$ script/plugin install git://path\_to\_spiffy\_plugin

with

$ git submodule add git://path\_to\_spiffy\_plugin  
vendor/plugins/spiffy\_plugin

It seems to me that these are not exactly equivalent… aren’t there  
installation scripts that get run when one runs “script/plugin  
install”? Is it as simple as manually looking for a  
vendor/plugins/spiffy\_plugin/init.rb and running that script in Ruby?  
Or does it need to be run using (somehow) script/runner, so that the  
proper Rails environment is set up for the script.

Are there other things that script/plugin install does?

I notice that there is a -x option for script/plugin install, but that  
is specific to subversion. It doesn’t work with git.

Finally, for anybody who stumbles across this post in the future, I  
believe that the equivalent to the “-r” option for script/plugin  
install is “-b” for git submodules add. e.g.

$ script/plugin install  
git://github.com/ewildgoose/render\_component.git -r rails-2.3

becomes

$ git submodule add -b rails-2.3  
git://github.com/ewildgoose/render\_component.git  
vendor/plugins/render\_component

–wpd
