From 078b5c6f80217b85c4065f75e015c99a7d193072 Mon Sep 17 00:00:00 2001 From: "Timothy N. Tsvetkov" Date: Wed, 27 Apr 2011 19:09:18 +0400 Subject: [PATCH] migrate repost: more --- lib/tasks/migrate_repos_task.rake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/tasks/migrate_repos_task.rake b/lib/tasks/migrate_repos_task.rake index 54d7f30d4..7eadbdaa2 100644 --- a/lib/tasks/migrate_repos_task.rake +++ b/lib/tasks/migrate_repos_task.rake @@ -8,13 +8,20 @@ namespace :repositories do main = cooker.repositories.find_by_name!("main") repo_dirs.each do |repo_dir| - puts repo_dir project_name = File.basename(repo_dir, ".git") - puts project_name + puts "Creating project: #{project_name}" -# main.projects.create(:name => project_name, :unixname => project_name) -# Dir + if main.projects.find_by_name(:name => project_name) + 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