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