CLI for initializing projects in a configurable way.
 
 
 
 
 
 
Go to file
Joshua Potter 400388b262 Migrate to consolidated error handling. 2023-11-25 09:15:30 -07:00
.githooks Run formatting with additional rules. 2023-11-24 19:35:34 -07:00
include Migrate to consolidated error handling. 2023-11-25 09:15:30 -07:00
specs/test Add an error interface for arbitrary length messages. 2023-11-25 08:55:52 -07:00
src Migrate to consolidated error handling. 2023-11-25 09:15:30 -07:00
test Migrate to consolidated error handling. 2023-11-25 09:15:30 -07:00
.clang-format Run formatting with additional rules. 2023-11-24 19:35:34 -07:00
.envrc Add automatic, configured formatting. 2023-11-23 08:22:43 -07:00
.gitignore Rename once more to `bootstrap`. 2023-11-23 11:02:40 -07:00
Makefile Allow executing `run.sh`. 2023-11-24 20:29:24 -07:00
README.md Migrate to consolidated error handling. 2023-11-25 09:15:30 -07:00
flake.lock Add example `main.c` file. 2023-11-22 11:50:15 -07:00
flake.nix Rename once more to `bootstrap`. 2023-11-23 11:02:40 -07:00
main.c Migrate to consolidated error handling. 2023-11-25 09:15:30 -07:00

README.md

bootstrap

TODO:

  • Make free-ing data consistent with null pointers.
  • Add documentation throughout (ownership, docstrings, etc.).
  • Have main.c return status code of run.sh.
  • Organize variables in each function to the top?

CLI utility for initializing projects in reproducible ways.

Overview

Within the specs directory exists so-called specs. A spec is a directory containing an optional spec.json file and a run.sh file. The former is configured like so:

{
  versions: [...]
}

The keys of this top-level JSON object correspond to the parameters that are 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.

Development

This template includes an .envrc file for use with direnv.

Formatting

A pre-commit file is included in .githooks to ensure consistent formatting. Run the following to configure git to use it:

git config --local core.hooksPath .githooks/

If running direnv, this is done automatically provided git is installed and a repository is initialized.