1
0
This commit is contained in:
Zef Hemel 2023-11-13 10:32:40 +01:00
parent 95301a41ff
commit 1d7dc04f54
3 changed files with 12 additions and 13 deletions

View File

@ -54,8 +54,8 @@ export class DiskSpacePrimitives implements SpacePrimitives {
data,
meta: {
name: name,
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
lastModified: s.mtime?.getTime() || 0,
perm: "rw",
size: s.size,
contentType: contentType,
@ -109,8 +109,8 @@ export class DiskSpacePrimitives implements SpacePrimitives {
name: name,
size: s.size,
contentType: lookupContentType(name),
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
lastModified: s.mtime?.getTime() || 0,
perm: "rw",
};
} catch {
@ -147,8 +147,8 @@ export class DiskSpacePrimitives implements SpacePrimitives {
}
allFiles.push({
name: normalizeForwardSlashPath(name),
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
lastModified: s.mtime?.getTime() || 0,
contentType: mime.getType(fullPath) || "application/octet-stream",
size: s.size,
perm: "rw",

View File

@ -34,8 +34,8 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
const s = await Deno.stat(p);
return {
name: filePath,
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
lastModified: s.mtime?.getTime() || 0,
contentType: mime.getType(filePath) || "application/octet-stream",
size: s.size,
perm: "rw",
@ -57,8 +57,8 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
const s = await Deno.stat(p);
return {
name: filePath,
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
lastModified: s.mtime?.getTime() || 0,
contentType: mime.getType(filePath) || "application/octet-stream",
size: s.size,
perm: "rw",
@ -86,8 +86,8 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
const s = await Deno.stat(fullPath);
allFiles.push({
name: fullPath.substring(dirPath.length + 1),
created: s.birthtime!.getTime(),
lastModified: s.mtime!.getTime(),
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
lastModified: s.mtime?.getTime() || 0,
contentType: mime.getType(fullPath) || "application/octet-stream",
size: s.size,
perm: "rw",

View File

@ -23,7 +23,6 @@ export async function renderTemplate(
removeTags: ["template"],
});
templateText = renderToText(tree).trimStart();
// console.log(`Trimmed template: |${templateText}|`);
// If a 'frontmatter' key was specified in the frontmatter, use that as the frontmatter
if (frontmatter.frontmatter) {
if (typeof frontmatter.frontmatter === "string") {