Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 22, 2020
1 parent 193cff0 commit 337b3bd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit 337b3bd

Please sign in to comment.