From 67b6cfb8289b6330161ff28e921e4e5bd9d4d6ac Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Mon, 20 Jun 2011 18:27:57 -0700 Subject: [PATCH] Improve the rake standalone task --- tasks/standalone.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tasks/standalone.rb b/tasks/standalone.rb index 8f17149d..b29007d3 100644 --- a/tasks/standalone.rb +++ b/tasks/standalone.rb @@ -1,10 +1,7 @@ require 'ostruct' -desc "Build standalone distribution, block if zip of current version" -task :standalone_safe => [:require_pages_submodule, :protect_current_dist_zip, :build_spec_runner_html] - desc "Build standalone distribution" -task :standalone => [:require_pages_submodule, :build_spec_runner_html] do +task :standalone => [:require_pages_submodule, :protect_current_dist_zip, :build_spec_runner_html] do require 'tmpdir' zip_root = File.join(Dir.tmpdir, "zip_root") @@ -81,5 +78,14 @@ task :protect_current_dist_zip do dist_dir = File.join(root, 'pages/downloads') zip_file_name = File.join(dist_dir, "jasmine-standalone-#{version_string}.zip") - raise "STOPPED: #{zip_file_name} already exists" if File.exist?(zip_file_name) + zip_present_message = "\n\n" + zip_present_message << "==> STOPPED <==".red + zip_present_message << "\n\n" + zip_present_message << "The file ".red + "#{zip_file_name}" + " already exists.".red + "\n" + zip_present_message << "If you should be building the next version, update src/version.json" + zip_present_message << "\n" + zip_present_message << "If the version is correct, you must be trying to re-build the standalone ZIP. Delete the ZIP and rebuild." + zip_present_message << "\n" + + raise zip_present_message if File.exist?(zip_file_name) end