File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949dd_df = []
5050structure_def_names_descriptions = {}
5151
52+
53+ def run_subprocess (args : list [str ]) -> subprocess .CompletedProcess [bytes ]:
54+ return subprocess .run (
55+ args ,
56+ cwd = Path ().parent ,
57+ check = True ,
58+ stdout = subprocess .PIPE ,
59+ )
60+
61+
62+ if not Path ("./sushi/fsh-generated/resources" ).exists ():
63+ print ("Generating sushi files" )
64+ run_subprocess (["npm" , "install" ])
65+ run_subprocess (["npm" , "run" , "sushi-build" ])
66+
5267for resource_type in sample_sources_by_profile :
5368 with Path (sample_sources_by_profile [resource_type ]).open () as file :
5469 sample_resources_by_profile [resource_type ] = json .load (file )
86101]
87102
88103
89- def run_subprocess (args : list [str ]) -> subprocess .CompletedProcess [bytes ]:
90- return subprocess .run (
91- args ,
92- cwd = Path ().parent ,
93- check = True ,
94- stdout = subprocess .PIPE ,
95- )
96-
97-
98- run_subprocess (["npm" , "install" ])
99-
100104for walk_info in os .walk (dd_support_folder ):
101105 files = list (filter (lambda file : ".yaml" in file , walk_info [2 ]))
102106 for file_name in files :
Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ def load_code_systems(self):
338338
339339 # Check if the resources directory exists, if not run sushi build
340340 if not Path (relative_path ).exists ():
341+ run_command ("npm install" )
341342 run_command ("npm run sushi-build" )
342343
343344 try :
You can’t perform that action at this time.
0 commit comments