@@ -17,29 +17,36 @@ def execute(self, config: test) -> None:
17
17
18
18
YmlWriter .writeYmlFile (str (config .path / 'contentctl.yml' ), config .model_dump ())
19
19
20
- #Create the following empty directories:
21
- for emptyDir in ['lookups' , 'baselines' , 'docs' , 'reporting' , 'investigations' ]:
20
+ if config .bare :
21
+ #Create the following empty directories:
22
+ for emptyDir in ['lookups' , 'baselines' , 'docs' , 'reporting' , 'investigations' , 'app_template' ,
23
+ 'deployments' , 'detections' , 'data_sources' , 'macros' , 'stories' ]:
22
24
#Throw an error if this directory already exists
23
- (config .path / emptyDir ).mkdir (exist_ok = False )
25
+ (config .path / emptyDir ).mkdir (exist_ok = False )
24
26
25
-
26
- #copy the contents of all template directories
27
- for templateDir , targetDir in [
28
- ('../templates/app_template/' , 'app_template' ),
29
- ('../templates/deployments/' , 'deployments' ),
30
- ('../templates/detections/' , 'detections' ),
31
- ('../templates/data_sources/' , 'data_sources' ),
32
- ('../templates/macros/' ,'macros' ),
33
- ('../templates/stories/' , 'stories' ),
34
- ]:
35
- source_directory = pathlib .Path (os .path .dirname (__file__ ))/ templateDir
36
- target_directory = config .path / targetDir
37
- #Throw an exception if the target exists
38
- shutil .copytree (source_directory , target_directory , dirs_exist_ok = False )
27
+ else :
28
+ #Create the following empty directories:
29
+ for emptyDir in ['lookups' , 'baselines' , 'docs' , 'reporting' , 'investigations' ]:
30
+ #Throw an error if this directory already exists
31
+ (config .path / emptyDir ).mkdir (exist_ok = False )
32
+
33
+ #copy the contents of all template directories
34
+ for templateDir , targetDir in [
35
+ ('../templates/app_template/' , 'app_template' ),
36
+ ('../templates/deployments/' , 'deployments' ),
37
+ ('../templates/detections/' , 'detections' ),
38
+ ('../templates/data_sources/' , 'data_sources' ),
39
+ ('../templates/macros/' ,'macros' ),
40
+ ('../templates/stories/' , 'stories' ),
41
+ ]:
42
+ source_directory = pathlib .Path (os .path .dirname (__file__ ))/ templateDir
43
+ target_directory = config .path / targetDir
44
+ #Throw an exception if the target exists
45
+ shutil .copytree (source_directory , target_directory , dirs_exist_ok = False )
39
46
40
- # Create a README.md file. Note that this is the README.md for the repository, not the
41
- # one which will actually be packaged into the app. That is located in the app_template folder.
42
- shutil .copyfile (pathlib .Path (os .path .dirname (__file__ ))/ '../templates/README.md' ,'README.md' )
47
+ # Create a README.md file. Note that this is the README.md for the repository, not the
48
+ # one which will actually be packaged into the app. That is located in the app_template folder.
49
+ shutil .copyfile (pathlib .Path (os .path .dirname (__file__ ))/ '../templates/README.md' ,'README.md' )
43
50
44
51
45
52
print (f"The app '{ config .app .title } ' has been initialized. "
0 commit comments