ksud: re-extract ksud when necessary close #1242

This commit is contained in:
weishu
2024-01-04 12:08:58 +08:00
parent 097e291d93
commit b99701d216
4 changed files with 7 additions and 6 deletions

View File

@@ -45,8 +45,8 @@ pub fn ensure_dir_exists<T: AsRef<Path>>(dir: T) -> Result<()> {
}
}
pub fn ensure_binary<T: AsRef<Path>>(path: T, contents: &[u8]) -> Result<()> {
if path.as_ref().exists() {
pub fn ensure_binary<T: AsRef<Path>>(path: T, contents: &[u8], ignore_if_exist: bool) -> Result<()> {
if ignore_if_exist && path.as_ref().exists() {
return Ok(());
}