Skip to content

Commit

Permalink
enhance: put grapher page into date-stamped dir
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Feb 4, 2025
1 parent 0b0cb20 commit 26374c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion baker/buildLocalArchivalBake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import findProjectBaseDir from "../settings/findBaseDir.js"
import crypto from "crypto"
import { AssetMapEntry } from "@ourworldindata/types"
import { getVariableData } from "../db/model/Variable.js"
import dayjs from "dayjs"

const DATE_TIME_FORMAT = "YYYYMMDD-HHmmss"
const DIR = "archive"

const HASH_LENGTH = 8
Expand Down Expand Up @@ -109,7 +111,8 @@ const bakeDomainToFolder = async (
dir = DIR,
bakeSteps?: BakeStepConfig
) => {
dir = normalize(dir)
const dateTimeFormatted = dayjs().utc().format(DATE_TIME_FORMAT)
dir = path.join(normalize(dir), dateTimeFormatted)
await fs.mkdirp(dir)
await fs.mkdirp(path.join(dir, "grapher"))

Expand Down

0 comments on commit 26374c8

Please sign in to comment.