rosa-build/lib/tasks/pull_requests.rake

17 lines
536 B
Ruby
Raw Normal View History

2012-11-14 15:48:20 +00:00
namespace :pull_requests do
desc 'Remove temporary git repos for pull requests'
2014-01-21 04:51:49 +00:00
task clear: :environment do
Dir.chdir(File.join(APP_CONFIG['git_path'], 'temp_pull_requests')) do
2012-11-14 15:48:20 +00:00
say "Removing repos older one day:"
say `find -mindepth 3 -maxdepth 3 -type d -mtime +0`
`find -mindepth 3 -maxdepth 3 -type d -mtime +0 | xargs rm -rf`
2012-11-14 15:48:20 +00:00
say '-----'
say "Removing empty dir:"
2012-11-14 16:46:09 +00:00
say `find -maxdepth 2 -type d -empty`
`find -maxdepth 2 -type d -empty -delete`
2012-11-14 15:48:20 +00:00
say 'done!'
end
end
end