File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,18 @@ func indexesNeedUpdating(duration string) bool {
152
152
continue
153
153
}
154
154
155
- coreIndexPath := indexpath .Join (path .Base (URL .Path ))
155
+ // should handle:
156
+ // - package_index.json
157
+ // - package_index.json.sig
158
+ // - package_index.json.gz
159
+ // - package_index.tar.bz2
160
+ indexFileName := path .Base (URL .Path )
161
+ indexFileName = strings .TrimSuffix (indexFileName , ".tar.bz2" )
162
+ indexFileName = strings .TrimSuffix (indexFileName , ".gz" )
163
+ indexFileName = strings .TrimSuffix (indexFileName , ".sig" )
164
+ indexFileName = strings .TrimSuffix (indexFileName , ".json" )
165
+ // and obtain package_index.json as result
166
+ coreIndexPath := indexpath .Join (indexFileName + ".json" )
156
167
if coreIndexPath .NotExist () {
157
168
return true
158
169
}
You can’t perform that action at this time.
0 commit comments