From 72ddd7b7704f2087a52c9c0552446682918c513b Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Thu, 22 Jan 2026 23:14:08 +0100 Subject: Implement basic game files download logic Implement core clap arguments Respect XDG_BASE_DIR Currently library extraction is broken because it assumes every instace has it's own library folder. This should be refactored so instances share libraries Signed-off-by: Filip Wandzio --- src/util/fs.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/util/fs.rs (limited to 'src/util/fs.rs') diff --git a/src/util/fs.rs b/src/util/fs.rs new file mode 100644 index 0000000..b86c0d7 --- /dev/null +++ b/src/util/fs.rs @@ -0,0 +1,12 @@ +#![allow(dead_code)] + +use std::path::Path; + +use crate::errors::McError; + +pub async fn remove_if_exists(path: &Path) -> Result<(), McError> { + if path.exists() { + tokio::fs::remove_file(path).await?; + } + Ok(()) +} -- cgit v1.2.3