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):
35
35
with open (index_path , 'r' ) as fp :
36
36
services = json .load (fp ).get ('items' )
37
37
38
- file_names = []
38
+ cached_paths = []
39
39
for x in services :
40
40
if not x .get ("preferred" ):
41
41
continue
42
42
name = x .get ('name' )
43
43
if name in opts .skip :
44
44
continue
45
45
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 )
47
52
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 ))
53
54
54
55
if __name__ == '__main__' :
55
56
sys .exit (Main (sys .argv [1 :]))
You can’t perform that action at this time.
0 commit comments