gcd_cli/
lib.rs

1
2extern crate clap;
3extern crate console;
4extern crate regex;
5extern crate rusqlite;
6extern crate glob;
7extern crate indicatif;
8extern crate ctrlc;
9
10pub mod error;
11pub mod inputhandler;
12pub mod outputhandler;
13pub mod scriptfile;
14pub mod db;
15pub mod projectsfinder;
16pub mod config;
17pub mod constants;
18
19pub mod lib {
20    use std::path::PathBuf;
21    use anyhow::Result;
22    use crate::error::GcdError;
23
24    pub fn current_dir() -> Result<String> {
25        Ok(to_string(std::env::current_dir()?)?)
26    }
27
28    pub fn to_string(path: PathBuf) -> Result<String> {
29        Ok(path.to_str().ok_or_else(|| {
30            GcdError::new(format!("Failed to convert {}, not an utf8 path name", path.display()))
31        })?.to_owned())
32    }
33}