Does whitespace matter in nginx conf files?

616

It isn't removing all of your whitespace. It is reducing each chunk of whitespace to a single space. For most of your nginx.conf this won't hurt anything. If you have quoted strings with multiple spaces those will get changed too by the command above. You can check for that easily by greping for quotes in the template.

Rather than tweaking echo to preserve whitespace it might be easier to build your template as a heredoc in the script.

Getting rid of the extra whitespace could be useful to reduce memory footprints in an embedded environment, but unless you are severely resource constrained maintaining the formatting from template to actual configuration will make debugging much more pleasant.

Share:
616

Related videos on Youtube

Fred
Author by

Fred

Updated on September 18, 2022

Comments

  • Fred
    Fred over 1 year

    When I import Flutter in Swift, Xcode is telling me No Such Module 'Flutter' enter image description here

    I have noticed there are Pods and Development Pods directories. Flutter resides in Development Pods.

    enter image description here

    Other modules in Pods are accessible.

    Here is my Podfile:

    # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
    ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    
    platform :ios, '14.0'
    
    project 'Runner', {
      'Debug' => :debug,
      'Profile' => :release,
      'Release' => :release,
    }
    
    def flutter_root
      generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
      unless File.exist?(generated_xcode_build_settings_path)
        raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
      end
    
      File.foreach(generated_xcode_build_settings_path) do |line|
        matches = line.match(/FLUTTER_ROOT\=(.*)/)
        return matches[1].strip if matches
      end
      raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
    end
    
    require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
    
    flutter_ios_podfile_setup
    
    target 'Runner' do
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
      
      pod 'TensorFlowLiteSwift/CoreML' #, '~> 0.0.1-nightly'
    
    end
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
      end
    end
    

    Any ideas?

    • Christian Grabowski
      Christian Grabowski over 8 years
      I ended up just using confd, much better than this hack, but chicks did answer the question at hand I guess
    • Biclops
      Biclops over 2 years
      What are the contents of pod file?
    • Fred
      Fred over 2 years
      @Biclops added podfile
  • Christian Grabowski
    Christian Grabowski almost 9 years
    Sorry I should clarify, and will, I meant the whitespace in my indentation.
  • Biclops
    Biclops over 2 years
    Another guess is to blow out the pod file itself, and run the command that generated the podfile. Did you use flutter build ios or flutter build ipa to make the podfile?
  • Fred
    Fred over 2 years
    I did something similar to your shot in the dark and it worked. The Podfile was created by flutter. Thank you for your service.
  • Biclops
    Biclops over 2 years
    Please mark this answer as the one that worked for you, if you think my answer will help others. It encourages me and others to help others on Stack overflow.
  • Biclops
    Biclops over 2 years
  • Nerdy Bunz
    Nerdy Bunz over 2 years
    Did you guys just solve this problem: github.com/flutter/flutter/issues/92337 ??