mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 05:38:09 +02:00
fix: download the repository if the file is cached
This commit is contained in:
@@ -135,10 +135,12 @@ export default class GitHubDownload extends GitHubBase implements SourceBase {
|
|||||||
if (await storage.exists(file.originalCachePath)) {
|
if (await storage.exists(file.originalCachePath)) {
|
||||||
return storage.read(file.originalCachePath);
|
return storage.read(file.originalCachePath);
|
||||||
}
|
}
|
||||||
throw new AnonymousError("file_not_found", {
|
// will throw an error if the file is not in the repository
|
||||||
httpStatus: 404,
|
await file.originalPath();
|
||||||
object: file,
|
|
||||||
});
|
// the cache is not ready, we need to download the repository
|
||||||
|
await this.download();
|
||||||
|
return storage.read(file.originalCachePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFiles() {
|
async getFiles() {
|
||||||
|
|||||||
Reference in New Issue
Block a user