this repo has no description
1fn help() {
2 println!("\n\nHELP: tangled-on-commit\n\n")
3}
4
5#[derive(Debug)]
6struct Config {
7 handle: String,
8 repo_name: String,
9 shell: String,
10}
11
12fn load_config() -> Result<Config, ()> {
13 // load config from cli args if present
14 // if omitted, fallback to a local `tangled-on-commit.json` file
15 // if key omitted or file not found, fall back to env
16 // if env omitted, error out and quit
17
18 return Ok(Config {
19 handle: String::from(""),
20 repo_name: String::from(""),
21 shell: String::from("")
22 });
23}
24
25fn main() -> Result<(), ()> {
26
27 // load configuration
28 let config = match load_config() {
29 Ok(res) => res,
30 Err(_) => {
31 // q
32 return Err(())
33 }
34 };
35 println!("{:#?}", config);
36
37 // resolve handle to did
38 // resolve did+repoName to knotserver
39
40 // connect to /events on knotserver
41
42 // on event:
43 // parse json
44 // validate meets expected schema (allow unknown vals)
45 // filter by did and reponame
46 // exec shell command in user shell (/bin/sh as fallback)
47
48 return Ok(())
49}