Crates.io | dotjector |
lib.rs | dotjector |
version | 0.1.0 |
source | src |
created_at | 2021-07-25 00:16:08.07111 |
updated_at | 2021-08-21 12:27:08.212259 |
description | A dotfile templating and injection tool |
homepage | |
repository | https://gitlab.com/manuel2258/dotjector |
max_upload_size | |
id | 426940 |
size | 69,110 |
A dotfile generation, templating and injection tool, based on the tera templating engine.
cargo install dotjector
Nowadays coding comes with using a lot of 3rd party tools that most of the times requires some sort of configuration dotfile in the root of the git repository. This does not only clutter the root dir, but most of the times also requires having generic information, such as the project version, copy pasted in a lof of dotfiles. This is especially troubeling when working with microservices which do life in seperate repositories, but still most of the time require the same tooling configurations.
Dotjector generates config files based on template and context files.
Template files are config files with missing data, for example the Cargo.toml of this repo could look like this:
templates/Cargo.toml:
[package]
name = "{ project_config.name }"
version = "{ project_config.version }"
edition = "2018"
...
Context files provide the missing data:
configs/project_config.yaml:
name: dotjector
version: 0.1.0
Executing dotjector will then generate the file Cargo.toml with the interpolated values provided by the context files.
Dotjector was developed based on a idea that may or may not be best one. It might feels cumbersome to work with dotjector and may feels weird for people looking at a repo using it. So decide for your self whether it can be useful for your self, and if you find usecases that are worth noting make sure to get back to me. MRs are always welcome!
A example can be found in a seperate example repo.