refactor: move delete artifacts fn in helper for android lane

This commit is contained in:
Malo Léon 2023-07-05 16:46:45 +02:00
parent 289802d9bc
commit 4021345e0a
2 changed files with 8 additions and 3 deletions

View File

@ -50,9 +50,7 @@ module Fastlane
# Delete artifacts files # Delete artifacts files
artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json'] artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json']
artifacts.each do |file| Helper::AndroidCdHelper.delete_artifacts(artifacts)
File.delete(file) if File.exist?(file)
end
UI.success('🍺 Successfully build & deploy appbundle to Google Play Store') UI.success('🍺 Successfully build & deploy appbundle to Google Play Store')
end end

View File

@ -26,6 +26,13 @@ module Fastlane
str_variable = variable.strip if variable.class.to_s == "String" str_variable = variable.strip if variable.class.to_s == "String"
variable && !(str_variable.nil? || str_variable.empty?) variable && !(str_variable.nil? || str_variable.empty?)
end end
# Delete built files
def self.delete_artifacts(artifacts)
artifacts.each do |file|
File.delete(file) if File.exist?(file)
end
end
end end
end end
end end