From ac644ee3a4a4e27df93165b3a33f75f108375823 Mon Sep 17 00:00:00 2001 From: 1inguini <9647142@gmail.com> Date: Thu, 19 Jan 2023 16:20:28 +0900 Subject: [PATCH] doesFileExist_ == True for broken symlinks I wanted pass the symlink to `produces`, intending to make the target file of the symlink afterwards, but got error: `Files declared by produces not produced:`. --- src/General/Extra.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/General/Extra.hs b/src/General/Extra.hs index c9c28554..d7c5e4dc 100644 --- a/src/General/Extra.hs +++ b/src/General/Extra.hs @@ -232,7 +232,7 @@ handleSynchronous = handleBool (not . isAsyncException) -- System.Directory doesFileExist_ :: FilePath -> IO Bool -doesFileExist_ x = doesFileExist x `catchIO` \_ -> pure False +doesFileExist_ x = (||) <$> doesFileExist x <*> pathIsSymbolicLink x `catchIO` \_ -> pure False doesDirectoryExist_ :: FilePath -> IO Bool doesDirectoryExist_ x = doesDirectoryExist x `catchIO` \_ -> pure False