From 65a19a545ab1020d5a7f2d452ba304467ccda0de Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Tue, 7 Feb 2023 18:46:41 +0900 Subject: [PATCH] fix: Bing dir create failed --- hammerspoon/Spoons/BingDaily.spoon/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hammerspoon/Spoons/BingDaily.spoon/init.lua b/hammerspoon/Spoons/BingDaily.spoon/init.lua index bc328a1..5000ce6 100644 --- a/hammerspoon/Spoons/BingDaily.spoon/init.lua +++ b/hammerspoon/Spoons/BingDaily.spoon/init.lua @@ -71,9 +71,13 @@ local function bingRequest() end function create_dir(path) - if hs.fs.dir(path) == nil then - hs.fs.mkdir(path) - log.i("path: " .. path .. " create successfully!") + if hs.fs.displayName(path) == nil then + local result = hs.fs.mkdir(path) + if result == true then + log.i("path: " .. path .. " create successfully!") + else + log.i("path: " .. path .. " create failed!") + end end end