mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 20:43:41 +00:00
13 lines
380 B
Haskell
13 lines
380 B
Haskell
module Util.File where
|
|
|
|
import Startlude
|
|
|
|
import System.Directory
|
|
import System.IO.Error
|
|
|
|
removeFileIfExists :: MonadIO m => FilePath -> m ()
|
|
removeFileIfExists fileName = liftIO $ removeFile fileName `catch` handleExists
|
|
where
|
|
handleExists e | isDoesNotExistError e = return ()
|
|
| otherwise = throwIO e
|