Permalink
Browse files

Adding shorter aliases (db:config and plugins:update)

  • Loading branch information...
1 parent e5d11df commit 4038f278c79525ff12ea6d6cf2caa099bb30ba8d Winton Welsh committed Aug 20, 2008
Showing with 14 additions and 4 deletions.
  1. +4 −0 tasks/db.rake
  2. +10 −4 tasks/git.rake
View
@@ -1,3 +1,7 @@
+namespace :db do
+ task :config => 'app_helpers:db:config'
+end
+
namespace :app_helpers do
desc 'Runs db:config and creates database'
View
@@ -1,3 +1,7 @@
+namespace :plugins do
+ task :update => 'app_helpers:git:plugins:update'
+end
+
namespace :app_helpers do
desc 'Copies git assets to app'
@@ -25,20 +29,22 @@ namespace :app_helpers do
namespace :plugins do
desc 'Clones git repositories to vendor/plugins'
- task :install do
+ task :update do
eval(File.read('config/plugins.rb')).each do |url|
puts url
if url.include?('@')
dir = "vendor/plugins/#{File.basename(url, '.git')}"
- if File.exists?(dir)
- `cd #{dir}; git checkout master; git pull`
- else
+ unless File.exists?(dir)
`git clone #{url} #{dir}`
end
else
`ruby script/plugin install #{url}`
end
end
+ Dir["#{RAILS_ROOT}/**/*/.git"].each do |dir|
+ puts dir
+ `cd #{dir}/../; git checkout master; git pull origin master`
+ end
end
end
end

0 comments on commit 4038f27

Please sign in to comment.