MCPcopy Create free account
hub / github.com/elastio/devx / main

Function main

xtask/src/main.rs:20–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 install-pre-commit-hook Install git pre-commit hook that formats code with `cargo fmt`";
19
20fn main() -> Result<()> {
21 simple_logger::SimpleLogger::new().init().unwrap();
22
23 if let Some(true) = env::args().next().map(|it| it.contains("pre-commit")) {
24 return pre_commit::run_hook();
25 }
26
27 let mut args = pico_args::Arguments::from_env();
28
29 match args.subcommand()?.unwrap_or_default().as_str() {
30 "install-pre-commit-hook" => {
31 args.finish()?;
32 pre_commit::install_hook()?;
33 eprintln!("Git pre-commit hook is successfully installed. Have a nice day :D");
34 }
35 _ => eprintln!("{}", HELP),
36 }
37 Ok(())
38}

Callers

nothing calls this directly

Calls 2

run_hookFunction · 0.85
install_hookFunction · 0.85

Tested by

no test coverage detected