/// PARAMS: none.
/// initializes the Gee struct by attempting to
/// read in data from metadata.json into the
/// repositories struct, and creating if it
/// does not exist.
none.
initializes the Gee struct by attempting to
read in data from metadata.json into the
repositories struct, and creating if it
does not exist.
none . initializes the Gee struct by attempting to read in data from metadata . json into the repositories struct and creating if it does not exist .
pub fn new() -> Self {
        if utils::file_exists(&utils::prefix_home(".gee/metadata.json")) {
            let file = File::open(&utils::prefix_home(".gee/metadata.json")).unwrap();
            let mut gee: Gee =
                serde_json::from_reader(file).expect("could not deserialize metadata.json");
            gee.current_dir = utils::return_curr_dir();
            return gee;
        } else {
            Gee {
                repositories: VecDeque::new(),
                config: Config {
                    queue_size: 5,
                    github_token: "".to_string(),
                },
                current_dir: "".to_string(),
                open_link: "".to_string(),
            }
        }
    }
pub fn new ( ) -> Self { if utils :: file_exists ( & utils :: prefix_home ( " " ) ) { let file = File :: open ( & utils :: prefix_home ( " " ) ) . unwrap ( ) ; let mut gee : Gee = serde_json :: from_reader ( file ) . expect ( " " ) ; gee . current_dir = utils :: return_curr_dir ( ) ; return gee ; } else { Gee { repositories : VecDeque :: new ( ) , config : Config { queue_size : 5 , github_token : " " . to_string ( ) , } , current_dir : " " . to_string ( ) , open_link : " " . to_string ( ) , } } }
PARAMS: none.
PARAMS : none .