summaryrefslogtreecommitdiff
path: root/src/types.rs
diff options
context:
space:
mode:
authorNaz <ndpm13@ch-naseem.com>2025-07-28 15:49:36 +0100
committerNaz <ndpm13@ch-naseem.com>2025-07-28 15:49:36 +0100
commit3c65c61a1a688c9af72855dbf9d3a6eb598299d9 (patch)
tree8485f036c84a8b040a018a264f0e8ade3bb156e7 /src/types.rs
parent80e762773af05b7808eef34f1abab40c358c0c9d (diff)
🐛fix: create the index dir before the index files
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/types.rs b/src/types.rs
index be3f3ed..fef9071 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -25,6 +25,8 @@ pub struct SourceMetadata {
impl AppImage {
pub async fn save_to_index(&self, appname: &str) -> Result<(), Box<dyn std::error::Error>> {
+ fs::create_dir_all(&index_dir()).await?;
+
let index_file = &index_dir().join(format!("{appname}.json"));
let json = serde_json::to_string_pretty(self)?;