fix: fix ksud install error (#550)

Signed-off-by: Tools-app <localhost.hutao@gmail.com>
This commit is contained in:
生于生时 亡于亡刻
2025-11-08 20:01:58 +08:00
committed by GitHub
parent 7479c0b81b
commit 7b4b5b431f

View File

@@ -46,7 +46,7 @@ pub fn ensure_file_exists<T: AsRef<Path>>(file: T) -> Result<()> {
pub fn ensure_dir_exists<T: AsRef<Path>>(dir: T) -> Result<()> { pub fn ensure_dir_exists<T: AsRef<Path>>(dir: T) -> Result<()> {
let result = create_dir_all(&dir); let result = create_dir_all(&dir);
if dir.as_ref().is_dir() && result.is_err() { if dir.as_ref().is_dir() && result.is_ok() {
Ok(()) Ok(())
} else { } else {
bail!("{} is not a regular directory", dir.as_ref().display()) bail!("{} is not a regular directory", dir.as_ref().display())