def write_to_disk(path)
      
      # code here mimics the original method but with link filtering
      filename = File.basename(path)
      path.dirname.mkpath unless path.dirname.exist?
      yaml = to_link_yaml
      File.open(path, 'w') { |f| f.write(yaml) }
      self.defined_in_file = path
    end
def write_to_disk(path)
      
      # code here mimics the original method but with link filtering
      filename = File.basename(path)
      path.dirname.mkpath unless path.dirname.exist?
      yaml = to_link_yaml
      File.open(path, 'w') { |f| f.write(yaml) }
      self.defined_in_file = path
    end
Hook the Podfile.lock file generation to allow us to filter out the links added to the
 Podfile.lock. The logic here is to replace the new Podfile.lock link content with what existed
 before the link was added. Currently, this is called for both Podfile.lock and Manifest.lock
 file so we only want to alter the Podfile.lock

 @param path path to write the .lock file to