Little Rust tool that generates scripts for run-parts from a central config file
Přejít na soubor
Jan Christian Grünhage 5c09e4fea5
feat: add basic functionality
2017-12-12 19:27:51 +01:00
src feat: add basic functionality 2017-12-12 19:27:51 +01:00
.gitignore feat: add basic functionality 2017-12-12 19:27:51 +01:00
Cargo.lock feat: add basic functionality 2017-12-12 19:27:51 +01:00
Cargo.toml feat: add basic functionality 2017-12-12 19:27:51 +01:00
LICENSE Initial commit 2017-12-11 22:54:31 +00:00
README.md feat: add basic functionality 2017-12-12 19:27:51 +01:00
config.example.toml feat: add basic functionality 2017-12-12 19:27:51 +01:00

README.md

run-parts generator

A little tool to write scripts to folders for usage with run-parts, based on definitions in a toml file. Written mostly for educational purposes, it would probably be easier to write the scripts themselves, than to take care of a config file where they are defined.

Usage:

Assuming you have a config file config.toml in the directory you are currently in, generating the scripts from it is as easy as running

run-parts-gen-rs config.toml

If something doesn't work, you should see output complaining. If something went wrong but you see no output, try adding -v to the command, and again if that didn't help (but not more than four -v's). This will enable more verbose logging.

Config file:

There is an example config file in this repository, called config.example.toml, you can orient yourself on that.

The most basic valid config file only contains the line

reduce_to_config = true

To then add actual functionality, add a folder block:

[[folders]]
path = ''

And to that folder block add a script block for each script you want to add to that folder:

[[folders.scripts]]
name = ''
commands = ['']

You can add as many folder blocks as you want, and to those folder blocks as many script blocks as you want. This should be enough to get you going, gl hf!

Dependencies:

You're going to need ..

  • cargo
  • ~/.cargo/bin/ in your $PATH
  • Internet access

I'll assume the third thing is already present, to get the first two, head over to rustup.

Installation

Clone the source code to rpg-rs

git clone https://git.jcg.re/jcgruenhage/run-parts-gen-rs.git rpg-rs

Enter the just cloned source directory

cd rpg-rs

Compile a release build

cargo install

You should now have the binary in ~/.cargo/bin