File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -35,21 +35,22 @@ def Main(args):
3535 with open (index_path , 'r' ) as fp :
3636 services = json .load (fp ).get ('items' )
3737
38- file_names = []
38+ cached_paths = []
3939 for x in services :
4040 if not x .get ("preferred" ):
4141 continue
4242 name = x .get ('name' )
4343 if name in opts .skip :
4444 continue
4545 version = x .get ('version' )
46- file_names .append (f'{ name } .{ version } .json' )
46+ file_name = f'{ name } .{ version } .json'
47+ cached_path = os .path .join (opts .cache_dir , file_name )
48+ if os .path .isfile (cached_path ):
49+ cached_paths .append (cached_path )
50+ else :
51+ print (f'WARNING: { file_name } not found, skipping' , file = sys .stderr )
4752
48- perferred_paths = [
49- os .path .join (opts .cache_dir , x )
50- for x in file_names
51- ]
52- print (" " .join (perferred_paths ))
53+ print (" " .join (cached_paths ))
5354
5455if __name__ == '__main__' :
5556 sys .exit (Main (sys .argv [1 :]))
You can’t perform that action at this time.
0 commit comments