Skip to content

A general-purpose project scaffolding tool inspired by cookiecutter

License

Notifications You must be signed in to change notification settings

block/scaffolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f7bf8ae Β· Nov 9, 2024

History

58 Commits
Nov 9, 2024
Sep 6, 2024
Nov 9, 2024
Nov 9, 2024
Nov 9, 2024
Apr 10, 2024
Aug 19, 2024
Aug 24, 2024
Oct 26, 2023
Nov 9, 2024
Oct 26, 2023
Nov 9, 2024
Nov 9, 2024
Oct 17, 2024
Nov 9, 2024
Dec 19, 2023
Nov 9, 2024
Dec 11, 2023

A general-purpose project scaffolding library and tool inspired by cookiecutter

stability-experimental Go Reference CI

Scaffolder evaluates the scaffolding files at the given destination against ctx using the following rules:

  • Templates are evaluated using the Go template engine.
  • Both path names and file contents are evaluated.
  • If a file name ends with .tmpl, the .tmpl suffix is removed.
  • If a file or directory name evalutes to the empty string it will be excluded.
  • If a file named template.js exists in the root of the template directory, all functions defined in this file will be available as Go template functions.
  • Directory and file names in templates can be expanded multiple times using the push function. This function takes two arguments, the file/directory name and the context to use when evaluating templates within the file/directory.

Examples

Multiple directories

template/
  {{ range .Modules }}{{ push .Name  . }}{{ end }}/
    file.txt