Skip to content

Commit 6486ce0

Browse files
committed
conform to XDG spec in the interpreter
Previously, the interpreter stored built files in the $HOME directory of the user. To conform to the XDG specification this was changed to $XDG_CACHE_HOME
1 parent c80571c commit 6486ce0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Compile/Options.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Data.Hashable
3939
import Control.Monad ( when )
4040
import qualified System.Info ( os, arch )
4141
import System.Environment ( getArgs )
42-
import System.Directory ( doesFileExist, doesDirectoryExist, getHomeDirectory, getTemporaryDirectory )
42+
import System.Directory ( doesFileExist, doesDirectoryExist, getHomeDirectory, getTemporaryDirectory, getXdgDirectory, XdgDirectory(XdgCache) )
4343
import Platform.GetOptions
4444
import Platform.Config
4545
import Lib.PPrint
@@ -882,9 +882,8 @@ getKokaBuildDir "" eval
882882
then return kkbuild
883883
else do -- avoid the tmp directory as it does not always have execute permissions
884884
-- tmp <- getTemporaryDirectory
885-
-- instead use `$HOME/.koka` if in the interpreter
886-
home <- getHomeDirectory
887-
return (joinPath home kkbuild)
885+
-- instead use `$XDG_CACHE_HOME/koka` if in the interpreter
886+
getXdgDirectory XdgCache "koka"
888887
else return kkbuild
889888
getKokaBuildDir buildDir _ = return buildDir
890889

0 commit comments

Comments
 (0)