@newspapper/core
    Preparing search index...

    Function reserveOutputDir

    • Pick the next YYYY-MM-DD-N directory and create it, so no other render can pick the same one.

      nextOutputDir only computes a name; creating it used to wait for writeRun, after a multi-second render loop. Two renders started together (a double-clicked Render, or two posts at once) both picked the same N, and both wrote their slides into one directory: last write won per file, and a post's export could show another post's images. A non-recursive mkdir is the reservation: it fails with EEXIST if anyone, in this process or another, got there first, and then the next number is tried.

      Parameters

      • date: string
      • OptionaloutputRoot: string

      Returns string