Files
start-os/agent/src/Util/File.hs
Aiden McClelland 95d3845906 0.2.5 initial commit
Makefile incomplete
2020-11-23 13:44:28 -07:00

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