bootstrap/README.md

96 lines
1.6 KiB
Markdown
Raw Normal View History

2023-11-23 18:02:40 +00:00
# bootstrap
2023-11-25 19:43:41 +00:00
CLI utility for defining custom project initialization scripts.
TODO:
- [ ] Add evaluator tests.
- [ ] Color output to console.
## Overview
2023-11-25 19:43:41 +00:00
`bootstrap` is a tool for quickly defining your own init-like scripts. If you
are familiar with tools like
* `npm init`
* `nix flake init`
* `django-admin startproject`
* `mix phx.new`
* etc.
2023-11-25 19:43:41 +00:00
this project will feel at home. Ultimately the goal is to create (optionally)
interactive scripts like those mentioned in the above list to quickly scaffold
your new projects in a consistent way.
We start with an example. Consider the following *spec*, which we'll name
`example`:
```json
{
2023-11-25 19:43:41 +00:00
"filename": {
"type": "STRING",
"prompt": "What file should I create for you?"
}
}
```
2023-11-25 19:43:41 +00:00
and its associated *builder*:
```bash
#!/usr/bin/env bash
echo "Creating $FILENAME"
touch "$OUT/$FILENAME"
```
Running `bootstrap` with these two files configured will invoke the following
interactive script:
```bash
> bootstrap example
What file should I create for you? hello-world.txt
Creating hello-world.txt
>
```
You should now see a new `hello-world.txt` file in the current directory.
2023-11-25 19:43:41 +00:00
## Usage
2023-11-25 19:43:41 +00:00
TODO
2023-11-25 19:43:41 +00:00
### Installation
TODO
### Specs and Builders
TODO
### Other Environment Variables
TODO
### Supplied Specs
TODO
### Using With Nix
TODO
2023-11-23 15:21:50 +00:00
## Development
2023-11-25 19:43:41 +00:00
TODO
### Documentation
TODO
2023-11-23 15:21:50 +00:00
### 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/
```
2023-11-25 19:43:41 +00:00
If running [direnv](https://direnv.net/), this is done automatically if `git` is
installed.