2012-08-29 03:13:22 +02:00
|
|
|
require 'fileutils'
|
|
|
|
|
|
|
|
print "Unpacking seed repository..."
|
|
|
|
|
|
|
|
SEED_REPO = 'seed_project.tar.gz'
|
2012-09-26 20:52:01 +02:00
|
|
|
REPO_PATH = Rails.root.join('tmp', 'repositories')
|
2012-08-29 03:13:22 +02:00
|
|
|
|
|
|
|
# Make whatever directories we need to make
|
|
|
|
FileUtils.mkdir_p(REPO_PATH)
|
|
|
|
|
|
|
|
# Copy the archive to the repo path
|
2012-09-26 20:52:01 +02:00
|
|
|
FileUtils.cp(Rails.root.join('spec', SEED_REPO), REPO_PATH)
|
2012-08-29 03:13:22 +02:00
|
|
|
|
|
|
|
# chdir to the repo path
|
|
|
|
FileUtils.cd(REPO_PATH) do
|
|
|
|
# Extract the archive
|
|
|
|
`tar -xf #{SEED_REPO}`
|
|
|
|
|
|
|
|
# Remove the copy
|
|
|
|
FileUtils.rm(SEED_REPO)
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
2012-08-29 03:13:22 +02:00
|
|
|
|
|
|
|
puts ' done.'
|