Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move install hooks task into cap recipe

  • Loading branch information...
commit 53b268b6d60d8fe249add44ee14948092b3b8610 1 parent 72fc981
@josh josh authored
View
10 lib/cached_externals.rb
@@ -87,6 +87,16 @@
end
end
end
+
+ desc "Install some git hooks for updating cached externals"
+ task :install_hooks, :except => { :no_release => true } do
+ require 'fileutils'
+
+ Dir[File.expand_path('../../script/git-hooks', __FILE__) + '/*'].each do |hook|
+ FileUtils.cp hook, ".git/hooks"
+ FileUtils.chmod 0755, ".git/hooks/#{File.basename(hook)}"
+ end
+ end
end
# Need to do this before finalize_update, instead of after update_code,
View
4 script/git-hooks/post-checkout
@@ -1,6 +1,6 @@
#!/bin/sh
-if [[ "1" == $3 && -d vendor/plugins/cached_externals ]];
+if [[ "1" == $3 && -f config/externals.yml ]];
then
- cap -q -f vendor/plugins/cached_externals/lib/cached_externals.rb local externals:setup
+ cap -q local externals:setup
fi;
View
4 script/git-hooks/post-merge
@@ -1,6 +1,6 @@
#!/bin/sh
-if [ -d vendor/plugins/cached_externals ];
+if [ -f config/externals.yml ];
then
- cap -q -f vendor/plugins/cached_externals/lib/cached_externals.rb local externals:setup
+ cap -q local externals:setup
fi;
View
11 tasks/git.rake
@@ -1,11 +0,0 @@
-namespace :git do
- namespace :hooks do
- desc "Install some git hooks for updating cached externals"
- task :install do
- Dir["#{RAILS_ROOT}/vendor/plugins/cached_externals/script/git-hooks/*"].each do |hook|
- cp hook, ".git/hooks"
- chmod 0755, ".git/hooks/#{File.basename(hook)}"
- end
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.