File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
src/Database/Postgres/Temp/Internal Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
Changelog for tmp-postgres
2
+ - 1.35.0.0
3
+ - #256 Use TMP and TMPDIR as defaults for the tmp directory
4
+
2
5
- 1.34.1.0
3
6
- #229 Add a ` auto_explain ` config
4
7
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import System.IO.Temp (createTempDirectory)
45
45
import System.IO.Unsafe (unsafePerformIO )
46
46
import System.Process
47
47
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>) )
48
+ import Control.Applicative
48
49
49
50
{-|
50
51
@@ -785,7 +786,10 @@ setupConfig
785
786
setupConfig config@ Config {.. } = evalContT $ do
786
787
envs <- lift getEnvironment
787
788
thePort <- lift $ maybe getFreePort pure $ join $ getLast port
788
- let resourcesTemporaryDir = fromMaybe " /tmp" $ getLast temporaryDirectory
789
+ tmpEnv <- lift $ lookupEnv " TMP"
790
+ tmpDirEnv <- lift $ lookupEnv " TMPDIR"
791
+ let defaultTemp = fromMaybe " /tmp" $ tmpEnv <|> tmpDirEnv
792
+ resourcesTemporaryDir = fromMaybe defaultTemp $ getLast temporaryDirectory
789
793
resourcesInitDbCache = join $ getLast initDbCache
790
794
resourcesSocketDirectory <- ContT $ bracketOnError
791
795
(setupDirectoryType resourcesTemporaryDir " tmp-postgres-socket" socketDirectory) cleanupDirectoryType
Original file line number Diff line number Diff line change 1
1
name : tmp-postgres
2
- version : 1.34.1 .0
2
+ version : 1.35.0 .0
3
3
synopsis : Start and stop a temporary postgres
4
4
description : Start and stop a temporary postgres. See README.md
5
5
homepage : https://github.com/jfischoff/tmp-postgres#readme
You can’t perform that action at this time.
0 commit comments