pub fn dir_or_err<P>(path: P) -> Result<PathBuf>where
    P: AsRef<Path>,