bootstrap/README.md

48 lines
1.3 KiB
Markdown
Raw Normal View History

2023-11-23 18:02:40 +00:00
# bootstrap
TODO:
- [ ] Add documentation throughout (ownership, docstrings, etc.).
2023-11-22 21:43:20 +00:00
CLI utility for initializing projects in reproducible ways.
## Overview
Within the `specs` directory exists so-called *specs*. A spec is a directory
2023-11-23 18:02:40 +00:00
containing an optional `spec.json` file and a `run.sh` file. The former is
configured like so:
```spec.json
{
2023-11-23 22:01:58 +00:00
versions: [...]
}
```
The keys of this top-level JSON object correspond to the parameters that are
2023-11-23 18:02:40 +00:00
prompted by the `bootstrap init` curses interface. The value is used to
determine what kind of prompt `bootstrap` provides for the given question.
Possible value types include:
* `[...]` (list)
* This indicates a select option prompt. The user chooses amongst the values
specified in the JSON list.
Once all prompts are evaluated, the keys of the object are converted into
uppercase environment variables and passed to the `run.sh` file relative to the
current directory.
2023-11-23 15:21:50 +00:00
## Development
This template includes an `.envrc` file for use with [direnv](https://direnv.net/).
### Formatting
A `pre-commit` file is included in `.githooks` to ensure consistent formatting.
Run the following to configure `git` to use it:
```bash
git config --local core.hooksPath .githooks/
```
If running [direnv](https://direnv.net/), this is done automatically provided
`git` is installed and a repository is initialized.