Skip to content

dump_yaml does not dump new attributes you have added to a settings file #63

Open
@NurullahMorshed

Description

@NurullahMorshed

I am trying to manipulate the settings files for my CI pipeline. I can modify settings that already exist, but when I try to load a new setting attribute, it lets me add it to the entry, but when I run dum_yaml command, only settings attributes that already exist are changed. The new settings I have added are not in the file.

Specifically, I am manipulating the IL2CPP settings and trying to protect against a situation where someone has not enabled il2cpp and is missing the settings in the project settings file.

Steps to reproduce:

  1. project_settings_file = 'UnityProject/ProjectSettings/ProjectSettings.asset'
  2. doc = UnityDocument.load_yaml(project_settings_file)
  3. ProjectSettings = doc.entry
  4. ProjectSettings.testAttribute = {}
  5. ProjectSettings.testAttribute
  6. ProjectSettings.testAttribute["Test"] = "1"
  7. ProjectSettings.testAttribute["Test"]
  8. doc.dump_yaml()
  9. Open ProjectSettings file

Expected Results:
Project settings file has a new entry called testAttribute with a value of Test = 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions