Revert CHANGELOG on cancel

This commit is contained in:
Davide 2024-10-11 19:51:06 +02:00
parent 8c76f33d48
commit 2517c4b39b
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,7 @@
# update_fastlane
fastlane_require "dotenv"
fastlane_require "fileutils"
Dotenv.load ".env.secret"
setup_ci if ENV["CI"]
@ -27,10 +28,16 @@ lane :bump do |options|
date_format: "short"
)
path = "../#{logname}"
File.open(path, "w") { |file|
path_tmp = "#{path}.tmp"
File.open(path_tmp, "w") { |file|
file.write(log)
}
system("vim", path) or UI.user_error!("CHANGELOG editor cancelled")
if system("vim", path_tmp)
FileUtils.mv(path_tmp, path)
else
File.delete(path_tmp)
UI.user_error!("CHANGELOG editor cancelled")
end
end
version = options[:version]
build = options[:build]