update-flake-lock/src/template.ts

14 lines
339 B
TypeScript
Raw Normal View History

import Handlebars from "handlebars";
export function renderCommitMessage(
template: string,
flakeDotLock: string,
): string {
return render(template, { flake_dot_lock: flakeDotLock });
}
function render(template: string, inputs: Record<string, string>): string {
const tpl = Handlebars.compile(template);
return tpl(inputs);
}