fixed instances now point to games
This commit is contained in:
@@ -10,24 +10,19 @@ use crate::{types::link::Link, utils::walk_all_files};
|
||||
/// Available game
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct Game {
|
||||
install_location: PathBuf,
|
||||
path: PathBuf,
|
||||
}
|
||||
|
||||
impl Game {
|
||||
pub fn export_links(&self) -> Result<Vec<Link>, io::Error> {
|
||||
let links: Vec<Link> = walk_all_files(&self.install_location)?
|
||||
.map(|entry| {
|
||||
Link::new(
|
||||
entry.path(),
|
||||
entry.path().strip_prefix(&self.install_location).unwrap(),
|
||||
)
|
||||
})
|
||||
let links: Vec<Link> = walk_all_files(&self.path)?
|
||||
.map(|entry| Link::new(entry.path(), entry.path().strip_prefix(&self.path).unwrap()))
|
||||
.collect();
|
||||
|
||||
Ok(links)
|
||||
}
|
||||
|
||||
pub fn install_location(&self) -> &Path {
|
||||
&self.install_location
|
||||
&self.path
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user