UNPKG

@rr0/cms

Version:

RR0 Content Management System (CMS)

17 lines (16 loc) 525 B
import { writeFile } from "@javarome/fileutil"; /** * Saves the index file collected by the SourceCommand. */ export class SourceIndexStep { constructor(fileName, sourceCommand) { this.fileName = fileName; this.sourceCommand = sourceCommand; } execute(context) { context.log("Saving sources index at", this.fileName); const index = this.sourceCommand.registry; const indexJson = JSON.stringify(index); return writeFile(this.fileName, indexJson, "utf-8"); } }