| 1231 | end |
| 1232 | |
| 1233 | def sha512(source_path, destination_path) |
| 1234 | if File.exist?(destination_path) |
| 1235 | sha512 = File.read(destination_path).split[0] |
| 1236 | return if Digest::SHA512.file(source_path).hexdigest == sha512 |
| 1237 | end |
| 1238 | absolute_destination_path = File.expand_path(destination_path) |
| 1239 | Dir.chdir(File.dirname(source_path)) do |
| 1240 | sh("shasum", |
| 1241 | "--algorithm", "512", |
| 1242 | File.basename(source_path), |
| 1243 | out: absolute_destination_path, |
| 1244 | verbose: verbose?) |
| 1245 | end |
| 1246 | end |
| 1247 | |
| 1248 | def sign_dir(label, dir) |
| 1249 | progress_label = "Signing: #{label}" |