Fix for copying built Github pages to the submodule properly
This commit is contained in:
@@ -40,7 +40,7 @@ describe "Build Github Pages task" do
|
||||
@output.should match(/Congratulations, project dumped to/)
|
||||
end
|
||||
|
||||
it "should copy the pages output to the requested diretory" do
|
||||
it "should build the pages output to the requested diretory" do
|
||||
Dir.chdir File.join(pages_dir, 'pages_output') do
|
||||
pages = Dir.glob(File.join('**', '*'))
|
||||
|
||||
@@ -52,5 +52,18 @@ describe "Build Github Pages task" do
|
||||
pages.should include(File.join('css', 'screen.css'))
|
||||
end
|
||||
end
|
||||
|
||||
it "should copy the generated page files to the destination directory" do
|
||||
Dir.chdir pages_dir do
|
||||
pages = Dir.glob(File.join('**', '*'))
|
||||
|
||||
pages.should include('download.html')
|
||||
pages.should include('index.html')
|
||||
pages.should include(File.join('images', 'jasmine_logo.png'))
|
||||
pages.should include(File.join('images', 'pivotal_logo.gif'))
|
||||
pages.should include(File.join('css', 'pygments.css'))
|
||||
pages.should include(File.join('css', 'screen.css'))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -14,5 +14,18 @@ class JasmineDev < Thor
|
||||
inside File.join('pages', 'pages_source') do
|
||||
run_with_output "frank export #{pages_output}", :capture => true
|
||||
end
|
||||
|
||||
pages_files = Dir.chdir(pages_output) { Dir.glob('*') }
|
||||
|
||||
pages_files.each do |file|
|
||||
source_path = File.join(pages_output, file)
|
||||
destination_path = File.join(pages_dir, file)
|
||||
|
||||
if File.directory?(source_path)
|
||||
directory source_path, destination_path
|
||||
else
|
||||
copy_file source_path, destination_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user