UNPKG

semantic-commit-emoji

Version:
15 lines (14 loc) 514 B
import * as fs from "fs"; import processCommitMessage from "../index.js"; /** * Synchronously read in a string from the provided file, sends the contents * to the processor and writes back the resulting commit message. */ export default (config, filePath) => { const commitString = fs.readFileSync(filePath, "utf8"); const newCommitMessage = processCommitMessage(config, commitString); if (newCommitMessage === undefined) { return; } fs.writeFileSync(filePath, newCommitMessage); };