Skip to content

Instantly share code, notes, and snippets.

@radekwarisch
Last active February 9, 2021 17:36
Show Gist options
  • Save radekwarisch/e8a89bf2df96378b4ea5d57805535995 to your computer and use it in GitHub Desktop.
Save radekwarisch/e8a89bf2df96378b4ea5d57805535995 to your computer and use it in GitHub Desktop.
Copy templates util
export const copyTemplatesAnd = <TInputType>(
...plugins: (ChainableType<TInputType>)[]
) => (input: TInputType) => () => {
const {templatesPath, movePath, templateVariables, tree} = input;
const newTemplates = apply(url(templatesPath), [
template(templateVariables),
move(movePath),
...plugins.map(compose(input)),
]);
input.templates = newTemplates;
return tree;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment