Listen to git commits for a specific repo and run a shell command

Block out config loading

vielle.dev 55c93d2e 5ad7b51d

verified
Changed files
+35
src
+35
src/main.rs
··· 1 + fn help() { 2 + println!("tangled-on-commit") 3 + } 4 + 5 + #[derive(Debug)] 6 + struct Config { 7 + handle: String, 8 + repo_name: String, 9 + shell: String, 10 + } 11 + 12 + fn 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 + 1 25 fn main() -> Result<(), i32> { 26 + 2 27 // load configuration 28 + let config = match load_config() { 29 + Ok(res) => res, 30 + Err(_) => { 31 + // q 32 + return Err(1) 33 + } 34 + }; 35 + 36 + help(); 37 + println!("{:#?}", config); 3 38 4 39 // resolve handle to did 5 40 // resolve did+repoName to knotserver