Large "query" plug refactor into "directive"

This commit is contained in:
Zef Hemel
2022-10-28 16:17:40 +02:00
parent 366564f2ec
commit 540af411a0
47 changed files with 1000 additions and 870 deletions
+16 -8
View File
@@ -159,14 +159,22 @@ export class DiskSpacePrimitives implements SpacePrimitives {
})
) {
const fullPath = file.path;
const s = await Deno.stat(fullPath);
allFiles.push({
name: fullPath.substring(this.rootPath.length + 1),
lastModified: s.mtime!.getTime(),
contentType: mime.getType(fullPath) || "application/octet-stream",
size: s.size,
perm: "rw",
});
try {
const s = await Deno.stat(fullPath);
allFiles.push({
name: fullPath.substring(this.rootPath.length + 1),
lastModified: s.mtime!.getTime(),
contentType: mime.getType(fullPath) || "application/octet-stream",
size: s.size,
perm: "rw",
});
} catch (e: any) {
if (e instanceof Deno.errors.NotFound) {
// Ignore, temporariy file already deleted by the time we got here
} else {
console.error("Failed to stat", fullPath, e);
}
}
}
return allFiles;