17
17
18
18
19
19
class Add :
20
- """Class to handle the add subcommand."""
20
+ """Class to handle the add subcommand.
21
+
22
+ Attributes:
23
+ common_resources: List of common resources to copy.
24
+ """
21
25
22
26
common_resources = ("common.devfile" ,)
23
27
@@ -30,7 +34,6 @@ def __init__(
30
34
Args:
31
35
config: App configuration object.
32
36
"""
33
-
34
37
self ._resource_type : str = config .resource_type
35
38
self ._add_path : Path = Path (config .path )
36
39
self ._force = config .force
@@ -49,14 +52,21 @@ def run(self) -> None:
49
52
self ._scaffold ()
50
53
51
54
def _check_add_path (self ) -> None :
52
- """Validate the provided add path."""
55
+ """Validate the provided add path.
56
+
57
+ Raises:
58
+ CreatorError: If the add path does not exist.
59
+ """
53
60
if not self ._add_path .exists ():
54
- raise CreatorError (
55
- f"The path { self ._add_path } does not exist. Please provide an existing directory." ,
56
- )
61
+ msg = f"The path { self ._add_path } does not exist. Please provide an existing directory."
62
+ raise CreatorError (msg )
57
63
58
64
def _scaffold (self ) -> None :
59
- """Scaffold the specified resource file."""
65
+ """Scaffold the specified resource file.
66
+
67
+ Raises:
68
+ CreatorError: If there are conflicts and overwriting is not allowed.
69
+ """
60
70
self .output .debug (f"Started copying { self ._project } resource to destination" )
61
71
62
72
# Set up template data
@@ -93,7 +103,9 @@ def _scaffold(self) -> None:
93
103
return
94
104
95
105
if not self ._overwrite :
96
- question = "Some files in the destination directory may be overwritten. Do you want to proceed?"
106
+ question = (
107
+ "Files in the destination directory will be overwritten. Do you want to proceed?"
108
+ )
97
109
if ask_yes_no (question ):
98
110
copier .copy_containers (paths )
99
111
else :
0 commit comments