def read_config(io = nil)
      unless io
        root_path = ::Middleman::Application.root
        config_file_path = File.join(root_path, ".s3_sync")

        # skip if config file does not exist
        return unless File.exists?(config_file_path)

        io = File.open(config_file_path, "r")
      end

      config = (YAML.load(io) || {}).symbolize_keys

      config.each do |key, value|
        options[key.to_sym] = value
      end
    end
def read_config(io = nil)
      unless io
        root_path = ::Middleman::Application.root
        config_file_path = File.join(root_path, ".s3_sync")

        # skip if config file does not exist
        return unless File.exists?(config_file_path)

        io = File.open(config_file_path, "r")
      end

      config = (YAML.load(io) || {}).symbolize_keys

      config.each do |key, value|
        options[key.to_sym] = value
      end
    end
Read config options from an IO stream and set them on `self`. Defaults
 to reading from the `.s3_sync` file in the MM project root if it exists.

 @param io [IO] an IO stream to read from
 @return [void]