Skip to content

Commit

Permalink
chore: Refactor to use new ruamel-yaml syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
cpswan committed Oct 24, 2023
1 parent 50c6992 commit 4c9ecca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/add_dependency_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This is file is used in GITHub actions to resolve dependencies.
"""
import argparse
import ruamel.yaml
from ruamel.yaml import YAML
from os import path, stat

# Initialize parser
Expand All @@ -33,11 +33,12 @@ def main():


def add_dependency_overrides():
yaml=YAML()
with open(project_path + 'pubspec.yaml', 'r') as pubspec:
yaml_map = ruamel.yaml.round_trip_load(pubspec, preserve_quotes=True)
yaml_map = yaml.load(pubspec)

with open(project_path + 'dependency-overrides.yaml', 'r') as dependency_overrides_map:
dependency_map = ruamel.yaml.round_trip_load(dependency_overrides_map, preserve_quotes=True)
dependency_map = yaml.load(dependency_overrides_map)

# If dependency-overrides.yaml file is commented. Exit.
if not dependency_map:
Expand Down

0 comments on commit 4c9ecca

Please sign in to comment.