From 79ce3da4da6787fb563a674c9aa20e73f3a8e250 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 1 Jun 2012 15:23:27 -0700 Subject: [PATCH] Copy minimum necessary files to the bundle when LOAD_RESOURCES_FROM_DIR is set. --- Rakefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index 2cbb0d9a0..fc3becbb2 100644 --- a/Rakefile +++ b/Rakefile @@ -56,15 +56,17 @@ task :"copy-files-to-bundle" => :"verify-prerequisites" do dest = File.join(built_dir, contents_dir, "Resources") - %w(index.html src static vendor spec benchmark).each do |dir| - rm_rf File.join(dest, dir) - cp_r dir, File.join(dest, dir) - end + rm_rf File.join(dest, "index.html") + cp "index.html", File.join(dest, "index.html") - if ENV['LOAD_RESOURCES_FROM_DIR'] - sh "coffee -c #{dest}/src/stdlib/require.coffee" - else - sh "coffee -c #{dest}/src #{dest}/vendor #{dest}/spec" + sh "coffee -c -o #{dest}/src/stdlib src/stdlib/require.coffee" + unless ENV['LOAD_RESOURCES_FROM_DIR'] + %w(src static vendor spec benchmark).each do |dir| + rm_rf File.join(dest, dir) + cp_r dir, File.join(dest, dir) + end + + sh "coffee -c #{dest}/src #{dest}/vendor #{dest}/spec #{dest}/benchmark" end end