Skip to content

Commit abfba68

Browse files
committed
Add 'force' param to copy_examples
1 parent e96988f commit abfba68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/diffpy/cmi/packsmanager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def copy_examples(
137137
self,
138138
examples_to_copy: List[str],
139139
target_dir: Path = None,
140+
force: bool = False,
140141
) -> None:
141142
"""Copy examples or packs into the target or current working
142143
directory.
@@ -148,8 +149,11 @@ def copy_examples(
148149
target_dir : pathlib.Path, optional
149150
Target directory to copy examples into. Defaults to current
150151
working directory.
152+
force : bool, optional
153+
If ``True``, overwrite existing files. Defaults to ``False``.
151154
"""
152155
self._target_dir = target_dir.resolve() if target_dir else Path.cwd()
156+
self._force = force
153157

154158
if "all" in examples_to_copy:
155159
self._copy_all()
@@ -165,6 +169,7 @@ def copy_examples(
165169
f"No examples or packs found for input: '{item}'"
166170
)
167171
del self._target_dir
172+
del self._force
168173
return
169174

170175
def _copy_all(self):

0 commit comments

Comments
 (0)