bin/s3_website in s3_website-2.1.0 vs bin/s3_website in s3_website-2.1.1

- old
+ new

@@ -1,9 +1,10 @@ #!/usr/bin/env ruby require File.expand_path(File.dirname(__FILE__)+ '/../lib/s3_website') require 'colored' +require 'digest/md5' class Cfg < Thor desc 'create', 'Create a config file with placeholder values' def create config_file_src = File.dirname(__FILE__) + '/../resources/configuration_file_template.yml' @@ -155,11 +156,21 @@ found_jar = ([development_jar_path] + released_jar_lookup_paths). select { |jar_path| File.exists? jar_path }. first + def jar_has_valid_checksum(jar_path, logger) + expected_checksum = File.read(File.dirname(__FILE__) + '/../resources/s3_website.jar.md5') + found_checksum = Digest::MD5.file(jar_path).hexdigest + if expected_checksum == found_checksum + true + else + logger.info_msg "The jar file has invalid checksum. Expected #{expected_checksum} but got #{found_checksum}" + false + end + end jar_file = - if found_jar + if found_jar and jar_has_valid_checksum(found_jar, logger) found_jar else is_development = File.exists?(project_root + '/.git') if is_development Dir.chdir(project_root) {