@@ -1,11 +1,8 @@
11{-# OPTIONS_GHC -Wall #-}
22module Elm.Internal.Paths where
33
4−import System.Directory (doesFileExist)
5−import System.Environment (getEnv)
6−import System.FilePath ((</>))
4+import Build.Utils (getDataFile)
75import System.IO.Unsafe (unsafePerformIO)
8−import qualified Paths_Elm as This
96
107-- |Name of directory for all of a project's dependencies.
118dependencyDirectory :: FilePath
@@ -25,14 +22,3 @@ runtime = unsafePerformIO $ getDataFile "elm-runtime.js"
2522-- |The absolute path to Elm's core library documentation.
2623docs :: FilePath
2724docs = unsafePerformIO $ getDataFile "docs.json"
28−
29−-- |The absolute path to a data file
30−getDataFile :: FilePath -> IO FilePath
31−getDataFile name = do
32− path <- This.getDataFileName name
33− exists <- doesFileExist path
34− if exists
35− then return path
36− else do
37− env <- getEnv "ELM_HOME"
38− return (env </> name)