Skip to content

Commit dbb9163

Browse files
committed
Fix downloads by granting access to download folder
1 parent 94140c9 commit dbb9163

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

build-aux/com.ranfdev.Geopard.Devel.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"--socket=fallback-x11",
1616
"--socket=wayland",
1717
"--device=dri",
18-
"--share=network"
18+
"--share=network",
19+
"--filesystem=xdg-download/Geopard"
1920
],
2021
"build-options" : {
2122
"append-path" : "/usr/lib/sdk/rust-stable/bin",

build-aux/com.ranfdev.Geopard.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"--socket=fallback-x11",
1616
"--socket=wayland",
1717
"--device=dri",
18-
"--share=network"
18+
"--share=network",
19+
"--filesystem=xdg-download/Geopard"
1920
],
2021
"build-options" : {
2122
"append-path" : "/usr/lib/sdk/rust-stable/bin",

src/common/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ use url::Url;
1010
use crate::gemini;
1111

1212
pub static DOWNLOAD_PATH: Lazy<std::path::PathBuf> =
13-
Lazy::new(|| glib::user_special_dir(glib::UserDirectory::Downloads).unwrap());
13+
Lazy::new(|| {
14+
let mut download_path = glib::user_special_dir(glib::UserDirectory::Downloads)
15+
.expect("Can't access download directory");
16+
download_path.push("Geopard");
17+
if !download_path.exists() {
18+
std::fs::create_dir(&download_path).expect("Can't create download folder");
19+
}
20+
download_path
21+
});
1422

1523
pub static ABOUT_PAGE: &str = std::include_str!("../../README.gemini");
1624

0 commit comments

Comments
 (0)