#!/usr/bin/env ruby
require 'FileUtils'
FileUtils.rm_r "deployment", :force => true
deploydir = FileUtils.mkdir("deployment")
solodir = Dir.glob("solo*Folder");
solofiles = Dir.glob("solo*Folder/**");
# Copy all the files from the solodir into the deployment dir
solofiles.each { | f |
FileUtils.cp_r(f, "deployment/" )
}
mysplash = <
EOF
# Move the main.lzx.js file into just main.js, so that our webserver won't eat it
FileUtils.mv( "deployment/main.lzx.js", "deployment/main.js")
newindex = File.new("deployment/index.html", "w+");
# Rewrite the index a little bit
lines = IO.readlines("deployment/main.lzx.html");
# Change the reference to the compiled javascript file to be main.js,
# corresponding to the file name change we made above
lines.each { | l |
l.sub!("main.lzx.js", "main.js")
# Take out the lzsplash and put it a new one we like
l.sub!(//, mysplash)
}
newindex.puts lines.first(4)
newindex.puts " "
newindex.puts lines.last( lines.length - 4)
FileUtils.rm("deployment/main.lzx.html", :force => true )
FileUtils.rm("deployment/index.iphone.html", :force => true )