Skip to content

Commit 1596aae

Browse files
committed
!squash more
1 parent 3112239 commit 1596aae

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/vcspull/cli/add.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
log = logging.getLogger(__name__)
2020

2121

22-
def save_config_yaml(file_path: pathlib.Path, data: dict[str, t.Any]) -> None:
23-
"""Save dictionary to a YAML file."""
24-
with open(file_path, "w", encoding="utf-8") as f:
25-
yaml.dump(data, f, sort_keys=False, indent=2, default_flow_style=False)
26-
27-
2822
def create_add_subparser(parser: argparse.ArgumentParser) -> None:
2923
"""Configure :py:class:`argparse.ArgumentParser` for ``vcspull add``."""
3024
parser.add_argument(
@@ -234,7 +228,17 @@ def add_repo(
234228
raw_config[actual_base_dir_key][repo_name] = repo_url
235229

236230
try:
237-
save_config_yaml(config_file_path, raw_config)
231+
# save_config_yaml(config_file_path, raw_config) # Original call to local/helper
232+
# The main application code should use a robust save mechanism.
233+
# For now, directly writing, similar to the old save_config_yaml.
234+
with open(config_file_path, "w", encoding="utf-8") as f:
235+
yaml.dump(
236+
raw_config,
237+
f,
238+
sort_keys=False,
239+
indent=2,
240+
default_flow_style=False,
241+
)
238242
log.info(
239243
f"Successfully added '{repo_name}' ({repo_url}) to {config_file_path} under '{actual_base_dir_key}'.",
240244
)

0 commit comments

Comments
 (0)