1 module Store.Stage 2 ( stageFile 3 ) where 4 5 import Ops 6 import Files 7 import Store.Types 8 9 import System.Posix.Files.ByteString (fileExist) 10 11 stageFile :: RawFilePath -> Storage -> IO (Maybe RawFilePath) 12 stageFile f Storage{ storageStage = Just s } = 13 (sf `useWhen`) <$> fileExist sf where sf = s </> f 14 stageFile _ _ = return Nothing