Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/block/scaffolder
A general-purpose project scaffolding tool inspired by cookiecutter
https://github.com/block/scaffolder
Last synced: 4 days ago
JSON representation
A general-purpose project scaffolding tool inspired by cookiecutter
- Host: GitHub
- URL: https://github.com/block/scaffolder
- Owner: block
- License: apache-2.0
- Created: 2023-10-25T08:35:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T22:58:39.000Z (10 days ago)
- Last Synced: 2024-11-09T23:29:02.668Z (10 days ago)
- Language: Go
- Size: 106 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Governance: GOVERNANCE.md
Awesome Lists containing this project
README
# A general-purpose project scaffolding library and tool inspired by [cookiecutter]
[![stability-experimental](https://img.shields.io/badge/stability-experimental-orange.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#experimental) [![Go Reference](https://pkg.go.dev/badge/github.com/block/scaffolder.svg)](https://pkg.go.dev/github.com/block/scaffolder) [![CI](https://github.com/block/scaffolder/actions/workflows/ci.yml/badge.svg)](https://github.com/block/scaffolder/actions/workflows/ci.yml)
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
```gotemplate
template/
{{ range .Modules }}{{ push .Name . }}{{ end }}/
file.txt
```[cookiecutter]: https://github.com/cookiecutter/cookiecutter