File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 22from pathlib import Path
33
44def list_json_filenames (folder ):
5- return set (p .name for p in Path (folder ).glob ("*.json" ))
5+ p = Path (folder )
6+ if not p .exists ():
7+ print (f"Warning: Folder { folder } does not exist." )
8+ return set ()
9+ return set (f .name for f in p .glob ("*.json" ))
610
711def main (project_folder , library_folder ):
812 project_files = list_json_filenames (project_folder )
913 library_files = list_json_filenames (library_folder )
1014
11- missing_in_lib = project_files - library_files
12- missing_in_project = library_files - project_files
15+ missing_from_project = library_files - project_files
1316
14- if missing_in_lib or missing_in_project :
15- if missing_in_lib :
16- print (f"Files in project vendordeps but missing in library: { sorted (missing_in_lib )} " )
17- if missing_in_project :
18- print (f"Files in library vendordeps but missing in project: { sorted (missing_in_project )} " )
19- sys .exit (1 ) # Fail CI
17+ if missing_from_project :
18+ print (f"ERROR: The following vendordep files exist in the library but are missing from the project:" )
19+ for f in sorted (missing_from_project ):
20+ print (f" - { f } " )
21+ sys .exit (1 )
2022 else :
21- print ("Vendor dependency files match exactly! " )
23+ print ("Success: All library vendordep files exist in the project. " )
2224
2325if __name__ == "__main__" :
2426 if len (sys .argv ) != 3 :
You can’t perform that action at this time.
0 commit comments