Skip to content

Commit 51d52ce

Browse files
committed
feat: add AppImage file handling stub
1 parent a086bc5 commit 51d52ce

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/appimage.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use std::path::Path;
2+
3+
use crate::error::{Error, Result};
4+
5+
pub struct AppImage {
6+
#[allow(dead_code)]
7+
path: Box<Path>,
8+
}
9+
10+
impl AppImage {
11+
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self> {
12+
let path = path.as_ref();
13+
14+
if !path.exists() {
15+
return Err(Error::AppImage(format!(
16+
"File does not exist: {}",
17+
path.display()
18+
)));
19+
}
20+
21+
if !path.is_file() {
22+
return Err(Error::AppImage(format!("Not a file: {}", path.display())));
23+
}
24+
25+
Ok(Self { path: path.into() })
26+
}
27+
28+
pub fn read_update_info(&self) -> Result<String> {
29+
todo!("Implement update info extraction from AppImage")
30+
}
31+
}

0 commit comments

Comments
 (0)