Last active
November 19, 2020 11:04
-
-
Save cohen72/2beb94123a135ed3d8be9c97c33eccf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def configure_assets(platform) | |
unique_whitelabel_id = ENV["UNIQUE_WHITELABEL_ID"] | |
ios_icon_file_path = "whitelabels/#{unique_whitelabel_id}/icon.png" | |
android_icon_file_path = "whitelabels/#{unique_whitelabel_id}/icon_android.png" | |
splash_file_path = "whitelabels/#{unique_whitelabel_id}/splash.png" | |
unless File.exist?(ios_icon_file_path) && File.exist?(android_icon_file_path) | |
UI.user_error!("1024x1024 'icon.png' file required in white label directory") | |
end | |
Dir.chdir("..") do | |
sh("react-native set-splash --platform #{platform} --path './fastlane/#{splash_file_path}' --resize contain --background '#{ENV["SPLASH_SCREEN_BG_COLOR"]}'") | |
if platform == "ios" | |
sh("react-native set-icon --platform #{platform} --path './fastlane/#{ios_icon_file_path}'") | |
end | |
if platform == "android" | |
sh("react-native set-icon --platform #{platform} --path './fastlane/#{android_icon_file_path}'") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment