forked from space-ros/space-ros
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace ruby script with python (issue ros2#158)
- Loading branch information
Showing
3 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import yaml | ||
|
||
# Load YAML repos files | ||
with open('ros2.repos', 'r') as ros2_file: | ||
ros2 = yaml.safe_load(ros2_file) | ||
|
||
with open('spaceros.repos', 'r') as spaceros_file: | ||
spaceros = yaml.safe_load(spaceros_file) | ||
|
||
# Merge repos | ||
for repo, data in spaceros['repositories'].items(): | ||
ros2['repositories'][repo] = data | ||
|
||
# Sort repositories and create a new ordered dictionary | ||
sorted_repositories = {repo: ros2['repositories'][repo] for repo in sorted(ros2['repositories'].keys())} | ||
ros2['repositories'] = sorted_repositories | ||
|
||
# Write the updated YAML back to file | ||
with open('ros2.repos', 'w') as ros2_file: | ||
yaml.dump(ros2, ros2_file, default_flow_style=False, explicit_start=True) |
This file was deleted.
Oops, something went wrong.