title: syntax error, unexpected =>, expecting end
body: <p>I'm trying to add an if statement to &quot;deliver&quot; action of fastlane.</p>
  <p>I use fastlane with bitrise and the problem I'm having is when I add the if statement to a working sentence it always throws this syntax error: &quot;syntax error, unexpected =&gt;, expecting end&quot;</p>
  <p>This is the code I have of the Fastfile:</p>
  <pre><code>default_platform(:ios)
  
  platform :ios do
    desc &quot;TEST&quot;
      lane :testEnv do
  
          deliver(
              app_version: ENV['APP_VERSION'],
              app_rating_config_path: &quot;./fastlane/app_store_rating_config.json&quot;,
              submit_for_review: false,
              screenshots_path: &quot;./fastlane/screenshots/&quot;,
              metadata_path: &quot;./fastlane/metadata/&quot;,
              force: true,
              #overwrite_screenshots: true,
              price_tier: 0,
              build_number: ENV['BITRISE_BUILD_NUMBER'],
              precheck_include_in_app_purchases: false,
              copyright: &quot;#{Time.now.year}&quot;,
              primary_category: &quot;EDUCATION&quot;,
              secondary_category: &quot;BOOKS&quot;,
              automatic_release: false,
  
              release_notes: {
                  if ENV['RELEASE_NOTES_ES'] != nil
                      &quot;es-ES&quot; =&gt; ENV['RELEASE_NOTES_ES'],
                  end
                  if ENV['RELEASE_NOTES_EN'] != nil
                      &quot;en-GB&quot; =&gt; ENV['RELEASE_NOTES_EN'],
                  end
                  if ENV['RELEASE_NOTES_PT'] != nil
                      &quot;pt-BR&quot; =&gt; ENV['RELEASE_NOTES_PT'],
                  end
                  if ENV['RELEASE_NOTES_ZH'] != nil
                      &quot;zh-Hans&quot; =&gt; ENV['RELEASE_NOTES_ZH'],
                  end
                  if ENV['RELEASE_NOTES_CA'] != nil
                      &quot;ca&quot; =&gt; ENV['RELEASE_NOTES_CA'],
                  end
              },
  
              privacy_url: {
                  if ENV['PRIVACY_URL_ES'] != nil
                      &quot;es-ES&quot; =&gt; ENV['PRIVACY_URL_ES']
                  end
                  if ENV['PRIVACY_URL_EN'] != nil
                      &quot;en-GB&quot; =&gt; ENV['PRIVACY_URL_EN']
                  end
                  if ENV['PRIVACY_URL_PT'] != nil
                      &quot;pt-BR&quot; =&gt; ENV['PRIVACY_URL_PT']
                  end
                  if ENV['PRIVACY_URL_EN'] != nil
                      &quot;zh-Hans&quot; =&gt; ENV['PRIVACY_URL_EN']
                  end
                  if ENV['PRIVACY_URL_ES'] != nil
                      &quot;ca&quot; =&gt; ENV['PRIVACY_URL_ES']
                  end
              },
  
              support_url: {
                  if ENV['SUPPORT_URL_ES'] != nil
                      &quot;es-ES&quot; =&gt; ENV['SUPPORT_URL_ES'],
                  end
                  if ENV['SUPPORT_URL_EN'] != nil
                      &quot;en-GB&quot; =&gt; ENV['SUPPORT_URL_EN'],
                  end
                  if ENV['SUPPORT_URL_PT'] != nil
                      &quot;pt-BR&quot; =&gt; ENV['SUPPORT_URL_PT'],
                  end
                  if ENV['SUPPORT_URL_EN'] != nil
                      &quot;zh-Hans&quot; =&gt; ENV['SUPPORT_URL_EN'],
                  end
                  if ENV['SUPPORT_URL_ES'] != nil
                      &quot;ca&quot; =&gt; ENV['SUPPORT_URL_ES'],
                  end
              },
  
              #APP METADATA INFORMATION
              name: {
                  if ENV['DESCRIPTION_ES'] != nil
                      &quot;es-ES&quot; =&gt; ENV['APP_NAME'],
                  end
                  if ENV['DESCRIPTION_EN'] != nil
                      &quot;en-GB&quot; =&gt; ENV['APP_NAME'],
                  end
                  if ENV['DESCRIPTION_PT'] != nil
                      &quot;pt-BR&quot; =&gt; ENV['APP_NAME'],
                  end
                  if ENV['DESCRIPTION_ZH'] != nil
                      &quot;zh-Hans&quot; =&gt; ENV['APP_NAME'],
                  end
                  if ENV['DESCRIPTION_CA'] != nil
                      &quot;ca&quot; =&gt; ENV['APP_NAME'],
                  end
              },
  
              description: {
                  if ENV['DESCRIPTION_ES'] != nil
                      &quot;es-ES&quot; =&gt; ENV['DESCRIPTION_ES'],
                  end
                  if ENV['DESCRIPTION_EN'] != nil
                      &quot;en-GB&quot; =&gt; ENV['DESCRIPTION_EN'],
                  end
                  if ENV['DESCRIPTION_PT'] != nil
                      &quot;pt-BR&quot; =&gt; ENV['DESCRIPTION_PT'],
                  end
                  if ENV['DESCRIPTION_ZH'] != nil
                      &quot;zh-Hans&quot; =&gt; ENV['DESCRIPTION_ZH'],
                  end
                  if ENV['DESCRIPTION_CA'] != nil
                      &quot;ca&quot; =&gt; ENV['DESCRIPTION_CA'],
                  end
              },
  
              keywords: {
                  if ENV['KEYWORDS_EN'] != nil
                      &quot;en-GB&quot; =&gt; ENV['KEYWORDS_EN'],
                  end
                  if ENV['KEYWORDS_ES'] != nil
                      &quot;es-ES&quot; =&gt; ENV['KEYWORDS_ES'],
                  end
                  if ENV['KEYWORDS_PT'] != nil
                      &quot;pt-BR&quot; =&gt; ENV['KEYWORDS_PT'],
                  end
                  if ENV['KEYWORDS_ZH'] != nil
                      &quot;zh-Hans&quot; =&gt; ENV['KEYWORDS_ZH'],
                  end
                  if ENV['KEYWORDS_CA'] != nil
                      &quot;ca&quot; =&gt; ENV['KEYWORDS_ES'],
                  end
              },
  
              submission_information: {
                  add_id_info_uses_idfa: false,
                  content_rights_contains_third_party_content: false,
                  export_compliance_platform: 'ios',
                  export_compliance_compliance_required: false,
                  export_compliance_encryption_updated: false,
                  export_compliance_uses_encryption: false,
                  content_rights_has_rights: false
              },
  
              app_review_information: {
                first_name: &quot;Name&quot;,
                last_name: &quot;Surname&quot;,
                phone_number: &quot;+34 99999999&quot;,
                email_address: &quot;name@mail.com&quot;,
                demo_user: ENV['DEMO_USER'],
                demo_password: ENV['DEMO_PASS'],
              }
          )
      end
  end
  </code></pre>
  <p>This is my complete Fastfile, the problem is that in my project we have a lot of targets for different clients, each of them with different languages. What I did was to save this information on environment varibles on the bitrise machine (they are defined on the bitrise yml).</p>
  <p>As you see I'm trying to add different languages depending on the environment variable, if it exists write this language too, but it is not working. I don't exactly know where is the problem because when I have it without ifs, it works as this example:</p>
  <pre><code>description: {
                  &quot;es-ES&quot; =&gt; ENV['DESCRIPTION_ES'],
                  &quot;en-GB&quot; =&gt; ENV['DESCRIPTION_EN'],
                  &quot;pt-BR&quot; =&gt; ENV['DESCRIPTION_PT'],
                  &quot;zh-Hans&quot; =&gt; ENV['DESCRIPTION_ZH'],
                  &quot;ca&quot; =&gt; ENV['DESCRIPTION_CA'],
          },
  </code></pre>
  <p>This piece of code works correctly.</p>
  <p>I don't have so much knowledge about ruby syntax, so maybe with your help I can achieve this, it would save me lot of time.</p>
  <p><strong>Thank you!</strong></p>