fn construct_check_dir_path<S: AsRef<str>, P: AsRef<Path>>( check_dir: S, initial_path: P, ) -> Result<String, Box<dyn Error>>