From 337b3bd41da407840d8e1e0aabe9281d1be54773 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Sun, 22 Nov 2020 16:11:32 +0530 Subject: [PATCH] :bug: Fix upptime/upptime#74 --- src/update.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/update.ts b/src/update.ts index f36ea0ad..4b2dbced 100644 --- a/src/update.ts +++ b/src/update.ts @@ -26,14 +26,13 @@ export const update = async (shouldCommit = false) => { const slug = site.slug || slugify(site.name); let currentStatus = "unknown"; let startTime = new Date(); - const siteHistory = safeLoad( - (await readFile(join(".", "history", `${slug}.yml`), "utf8")) - .split("\n") - .map((line) => (line.startsWith("- ") ? line.replace("- ", "") : line)) - .join("\n") - ) as SiteHistory; - try { + const siteHistory = safeLoad( + (await readFile(join(".", "history", `${slug}.yml`), "utf8")) + .split("\n") + .map((line) => (line.startsWith("- ") ? line.replace("- ", "") : line)) + .join("\n") + ) as SiteHistory; currentStatus = siteHistory.status || "unknown"; startTime = new Date(siteHistory.startTime || new Date()); } catch (error) {}