Fixes #563
This commit is contained in:
parent
95301a41ff
commit
1d7dc04f54
@ -54,8 +54,8 @@ export class DiskSpacePrimitives implements SpacePrimitives {
|
|||||||
data,
|
data,
|
||||||
meta: {
|
meta: {
|
||||||
name: name,
|
name: name,
|
||||||
created: s.birthtime!.getTime(),
|
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
|
||||||
lastModified: s.mtime!.getTime(),
|
lastModified: s.mtime?.getTime() || 0,
|
||||||
perm: "rw",
|
perm: "rw",
|
||||||
size: s.size,
|
size: s.size,
|
||||||
contentType: contentType,
|
contentType: contentType,
|
||||||
@ -109,8 +109,8 @@ export class DiskSpacePrimitives implements SpacePrimitives {
|
|||||||
name: name,
|
name: name,
|
||||||
size: s.size,
|
size: s.size,
|
||||||
contentType: lookupContentType(name),
|
contentType: lookupContentType(name),
|
||||||
created: s.birthtime!.getTime(),
|
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
|
||||||
lastModified: s.mtime!.getTime(),
|
lastModified: s.mtime?.getTime() || 0,
|
||||||
perm: "rw",
|
perm: "rw",
|
||||||
};
|
};
|
||||||
} catch {
|
} catch {
|
||||||
@ -147,8 +147,8 @@ export class DiskSpacePrimitives implements SpacePrimitives {
|
|||||||
}
|
}
|
||||||
allFiles.push({
|
allFiles.push({
|
||||||
name: normalizeForwardSlashPath(name),
|
name: normalizeForwardSlashPath(name),
|
||||||
created: s.birthtime!.getTime(),
|
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
|
||||||
lastModified: s.mtime!.getTime(),
|
lastModified: s.mtime?.getTime() || 0,
|
||||||
contentType: mime.getType(fullPath) || "application/octet-stream",
|
contentType: mime.getType(fullPath) || "application/octet-stream",
|
||||||
size: s.size,
|
size: s.size,
|
||||||
perm: "rw",
|
perm: "rw",
|
||||||
|
@ -34,8 +34,8 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
|
|||||||
const s = await Deno.stat(p);
|
const s = await Deno.stat(p);
|
||||||
return {
|
return {
|
||||||
name: filePath,
|
name: filePath,
|
||||||
created: s.birthtime!.getTime(),
|
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
|
||||||
lastModified: s.mtime!.getTime(),
|
lastModified: s.mtime?.getTime() || 0,
|
||||||
contentType: mime.getType(filePath) || "application/octet-stream",
|
contentType: mime.getType(filePath) || "application/octet-stream",
|
||||||
size: s.size,
|
size: s.size,
|
||||||
perm: "rw",
|
perm: "rw",
|
||||||
@ -57,8 +57,8 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
|
|||||||
const s = await Deno.stat(p);
|
const s = await Deno.stat(p);
|
||||||
return {
|
return {
|
||||||
name: filePath,
|
name: filePath,
|
||||||
created: s.birthtime!.getTime(),
|
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
|
||||||
lastModified: s.mtime!.getTime(),
|
lastModified: s.mtime?.getTime() || 0,
|
||||||
contentType: mime.getType(filePath) || "application/octet-stream",
|
contentType: mime.getType(filePath) || "application/octet-stream",
|
||||||
size: s.size,
|
size: s.size,
|
||||||
perm: "rw",
|
perm: "rw",
|
||||||
@ -86,8 +86,8 @@ export default function fileSystemSyscalls(root = "/"): SysCallMapping {
|
|||||||
const s = await Deno.stat(fullPath);
|
const s = await Deno.stat(fullPath);
|
||||||
allFiles.push({
|
allFiles.push({
|
||||||
name: fullPath.substring(dirPath.length + 1),
|
name: fullPath.substring(dirPath.length + 1),
|
||||||
created: s.birthtime!.getTime(),
|
created: s.birthtime?.getTime() || s.mtime?.getTime() || 0,
|
||||||
lastModified: s.mtime!.getTime(),
|
lastModified: s.mtime?.getTime() || 0,
|
||||||
contentType: mime.getType(fullPath) || "application/octet-stream",
|
contentType: mime.getType(fullPath) || "application/octet-stream",
|
||||||
size: s.size,
|
size: s.size,
|
||||||
perm: "rw",
|
perm: "rw",
|
||||||
|
@ -23,7 +23,6 @@ export async function renderTemplate(
|
|||||||
removeTags: ["template"],
|
removeTags: ["template"],
|
||||||
});
|
});
|
||||||
templateText = renderToText(tree).trimStart();
|
templateText = renderToText(tree).trimStart();
|
||||||
// console.log(`Trimmed template: |${templateText}|`);
|
|
||||||
// If a 'frontmatter' key was specified in the frontmatter, use that as the frontmatter
|
// If a 'frontmatter' key was specified in the frontmatter, use that as the frontmatter
|
||||||
if (frontmatter.frontmatter) {
|
if (frontmatter.frontmatter) {
|
||||||
if (typeof frontmatter.frontmatter === "string") {
|
if (typeof frontmatter.frontmatter === "string") {
|
||||||
|
Loading…
Reference in New Issue
Block a user