@@ -1734,23 +1734,17 @@ defaultTempFileOptions = TempFileOptions{optKeepTempFiles = False}
1734
1734
1735
1735
-- | Use a temporary filename that doesn't already exist
1736
1736
withTempFile
1737
- :: FilePath
1738
- -- ^ Temp dir to create the file in
1739
- -> String
1737
+ :: String
1740
1738
-- ^ File name template. See 'openTempFile'.
1741
1739
-> (FilePath -> Handle -> IO a )
1742
1740
-> IO a
1743
- withTempFile tmpDir template f = withFrozenCallStack $
1744
- withTempFileCwd Nothing (makeSymbolicPath tmpDir) template $
1741
+ withTempFile template f = withFrozenCallStack $
1742
+ withTempFileCwd template $
1745
1743
\ fp h -> f (getSymbolicPath fp) h
1746
1744
1747
1745
-- | Use a temporary filename that doesn't already exist.
1748
1746
withTempFileCwd
1749
- :: Maybe (SymbolicPath CWD (Dir Pkg ))
1750
- -- ^ Working directory
1751
- -> SymbolicPath Pkg (Dir tmpDir )
1752
- -- ^ Temp dir to create the file in
1753
- -> String
1747
+ :: String
1754
1748
-- ^ File name template. See 'openTempFile'.
1755
1749
-> (SymbolicPath Pkg File -> Handle -> IO a )
1756
1750
-> IO a
@@ -1759,17 +1753,13 @@ withTempFileCwd = withFrozenCallStack $ withTempFileEx defaultTempFileOptions
1759
1753
-- | A version of 'withTempFile' that additionally takes a 'TempFileOptions'
1760
1754
-- argument.
1761
1755
withTempFileEx
1762
- :: forall a tmpDir
1756
+ :: forall a
1763
1757
. TempFileOptions
1764
- -> Maybe (SymbolicPath CWD (Dir Pkg ))
1765
- -- ^ Working directory
1766
- -> SymbolicPath Pkg (Dir tmpDir )
1767
- -- ^ Temp dir to create the file in
1768
1758
-> String
1769
1759
-- ^ File name template. See 'openTempFile'.
1770
1760
-> (SymbolicPath Pkg File -> Handle -> IO a )
1771
1761
-> IO a
1772
- withTempFileEx opts _mbWorkDir _tmpDir template action = do
1762
+ withTempFileEx opts template action = do
1773
1763
tmp <- getTemporaryDirectory
1774
1764
withFrozenCallStack $
1775
1765
Exception. bracket
@@ -1783,7 +1773,6 @@ withTempFileEx opts _mbWorkDir _tmpDir template action = do
1783
1773
)
1784
1774
(withLexicalCallStack (\ (fn, h) -> action (mkRelToPkg tmp fn) h))
1785
1775
where
1786
- -- i = interpretSymbolicPath mbWorkDir -- See Note [Symbolic paths] in Distribution.Utils.Path
1787
1776
mkRelToPkg :: FilePath -> FilePath -> SymbolicPath Pkg File
1788
1777
mkRelToPkg tmp fp =
1789
1778
makeSymbolicPath tmp </> makeRelativePathEx (takeFileName fp)
0 commit comments