#!/bin/bash

# Add this script to your Scheme->Build->Post Actions

ASSETS_PATH=${CODESIGNING_FOLDER_PATH}/Assets.car

xcrun --sdk ${PLATFORM_NAME} assetutil --info ${ASSETS_PATH} | grep -q "DisplayGamut.*P3"
if [ $? -eq 0 ]; then
	osascript -e 'tell app "System Events" to display dialog "Some images are in Display P3 gamut, which is not supported in iOS 9.0~9.2"'
	# xcrun --sdk ${PLATFORM_NAME} assetutil --info ${ASSETS_PATH} > /tmp/assets.json
	# open /tmp/assets.json
fi