use relatedTempate in viaTmp

This commit is contained in:
Joey Hess 2019-03-04 14:12:00 -04:00
parent 3cd19fb4d0
commit 1ec9e1494c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -28,7 +28,7 @@ viaTmp :: (MonadMask m, MonadIO m) => (FilePath -> v -> m ()) -> FilePath -> v -
viaTmp a file content = bracketIO setup cleanup use
where
(dir, base) = splitFileName file
template = base ++ ".tmp"
template = relatedTemplate (base ++ ".tmp")
setup = do
createDirectoryIfMissing True dir
openTempFile dir template