Skip to content

Commit

Permalink
Added support for plugins to be installed as submodules with the appl…
Browse files Browse the repository at this point in the history
…ication templater. [#1517 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
peterc authored and lifo committed Dec 5, 2008
1 parent 731dcd8 commit 9eca588
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -57,16 +57,22 @@ def file(filename, data = nil, &block)
end

# Install a plugin. You must provide either a Subversion url or Git url.
# For a Git-hosted plugin, you can specify if it should be added as a submodule instead of cloned.
#
# ==== Examples
#
# plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
# plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true
# plugin 'restful-authentication', :svn => 'svn://svnhub.com/technoweenie/restful-authentication/trunk'
#
def plugin(name, options)
puts "installing plugin #{name}"

if options[:git] || options[:svn]
if options[:git] && options[:submodule]
in_root do
Git.run("submodule add #{options[:git]} vendor/plugins/#{name}")
end
elsif options[:git] || options[:svn]
in_root do
`script/plugin install #{options[:svn] || options[:git]}`
end
Expand Down

0 comments on commit 9eca588

Please sign in to comment.