diff --git a/Scripts/ensure_storefront_config b/Scripts/ensure_storefront_config new file mode 100755 index 00000000..e7dc924b --- /dev/null +++ b/Scripts/ensure_storefront_config @@ -0,0 +1,14 @@ + #!/usr/bin/env bash + +set -e + +if [ ! -f "./samples/MobileBuyIntegration/Storefront.xcconfig" ]; then + echo """ + Error: Your project is missing a Storefront.xcconfig file. + + Replace the STOREFRONT_DOMAIN and STOREFRONT_ACCESS_TOKEN environment variables in \"samples/MobileBuyIntegration/Storefront.xcconfig.example\" and rename the file to \"Storefront.xcconfig\" to get started. + + If you don't have a Shopify app setup, go to https://admin.shopify.com/settings/apps/development to configure an application for your storefront which will give you access to the Storefront API. + """ + exit 1; +fi diff --git a/dev.yml b/dev.yml index 31fcd286..ce2b1e63 100644 --- a/dev.yml +++ b/dev.yml @@ -4,9 +4,15 @@ type: ios up: - ruby + - custom: + name: Ensure Storefront.xcconfig file + met?: | + ([ -f "./samples/MobileBuyIntegration/Storefront.xcconfig" ] || exit 1) + meet: ./scripts/ensure_storefront_config - custom: name: Setup entitlements - met?: ([ -f "./samples/MobileBuyIntegration/MobileBuyIntegration/MobileBuyIntegration.entitlements" ] || exit 1;) + met?: | + ([ -f "./samples/MobileBuyIntegration/MobileBuyIntegration/MobileBuyIntegration.entitlements" ] || exit 1;) meet: ./scripts/setup_entitlements packages: