migrate repost: more

This commit is contained in:
Timothy N. Tsvetkov 2011-04-27 19:09:18 +04:00
parent cdda25fb24
commit 078b5c6f80
1 changed files with 11 additions and 4 deletions

View File

@ -8,13 +8,20 @@ namespace :repositories do
main = cooker.repositories.find_by_name!("main") main = cooker.repositories.find_by_name!("main")
repo_dirs.each do |repo_dir| repo_dirs.each do |repo_dir|
puts repo_dir
project_name = File.basename(repo_dir, ".git") project_name = File.basename(repo_dir, ".git")
puts project_name
puts "Creating project: #{project_name}"
# main.projects.create(:name => project_name, :unixname => project_name) if main.projects.find_by_name(:name => project_name)
# Dir puts "\t Already created. Skipping"
next
end
project = main.projects.create(:name => project_name, :unixname => project_name)
puts "Executing: 'rm -rf #{project.git_repo_path}'"
`rm -rf #{project.git_repo_path}`
# `cp -a #{repo_dir} #{project.git_repo_path}`
end end
end end