Runs a command of the `dev-scripts` executable.
()
| 24 | |
| 25 | /// Runs a command of the `dev-scripts` executable. |
| 26 | fn run_command() -> Result<(), Error> { |
| 27 | let cli = Cli::parse(); |
| 28 | SimpleLogger::init(cli.verbose.log_level_filter(), Config::default())?; |
| 29 | |
| 30 | match cli.cmd { |
| 31 | cli::Command::TestFiles { cmd, cache_dir } => { |
| 32 | let cache_dir = if let Some(path) = cache_dir { |
| 33 | CacheDir::from(path) |
| 34 | } else { |
| 35 | CacheDir::from_xdg()? |
| 36 | }; |
| 37 | |
| 38 | test_files(cmd, cache_dir) |
| 39 | } |
| 40 | cli::Command::CompareSrcinfo { |
| 41 | pkgbuild_path, |
| 42 | srcinfo_path, |
| 43 | } => compare_source_info(pkgbuild_path, srcinfo_path), |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | fn main() -> ExitCode { |
| 48 | if let Err(error) = run_command() { |
no test coverage detected