match/lib/match/nuke.rb in fastlane-2.166.0 vs match/lib/match/nuke.rb in fastlane-2.167.0

- old
+ new

@@ -250,14 +250,18 @@ files_to_delete = delete_files! end self.encryption.encrypt_files if self.encryption - # Now we need to commit and push all this too - message = ["[fastlane]", "Nuked", "files", "for", type.to_s].join(" ") - self.storage.save_changes!(files_to_commit: [], - files_to_delete: files_to_delete, - custom_message: message) + if files_to_delete.count > 0 + # Now we need to save all this to the storage too, if needed + message = ["[fastlane]", "Nuked", "files", "for", type.to_s].join(" ") + self.storage.save_changes!(files_to_commit: [], + files_to_delete: files_to_delete, + custom_message: message) + else + UI.message("Your storage had no files to be deleted. This happens when you run `nuke` with an empty storage. Nothing to be worried about!") + end end private def delete_files!