fix: fix ksud install error (#550)
Signed-off-by: Tools-app <localhost.hutao@gmail.com>
This commit is contained in:
@@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user