@@ -5,6 +5,7 @@ import Control.Monad.Error
5import System.Directory (doesFileExist)
5import System.Directory (doesFileExist)
6import System.Environment (getEnv)
6import System.Environment (getEnv)
7import System.FilePath ((</>), replaceExtension)
7import System.FilePath ((</>), replaceExtension)
8+import System.IO.Error (tryIOError)
8import qualified Build.Flags as Flag
9import qualified Build.Flags as Flag
9import qualified Build.Print as Print
10import qualified Build.Print as Print
10import qualified Paths_Elm as This
11import qualified Paths_Elm as This
@@ -33,8 +34,27 @@ getDataFile name = do
34 then return path
35 then return path
36− env <- getEnv "ELM_HOME"
37+ environment <- tryIOError (getEnv "ELM_HOME")
37− return (env </> name)
39+ Right env -> return (env </> name)
42+ [ "Unable to find the ELM_HOME environment variable when searching"
43+ , "for the " ++ name ++ " file."
45+ , "If you installed Elm Platform with the Mac or Windows installer, it looks like"
46+ , "ELM_HOME was not set automatically. Look up how to set environment variables"
47+ , "on your platform and set ELM_HOME to the directory that contains Elm's static"
50+ , " * On Mac it is /usr/local/share/elm"
51+ , " * On Windows it is one of the following:"
52+ , " C:/Program Files/Elm Platform/0.12.3/share"
53+ , " C:/Program Files (x86)/Elm Platform/0.12.3/share"
55+ , "If it seems like a more complex issue, please report it here:"
56+ , " <https://github.com/elm-lang/elm-platform/issues>"
39run :: ErrorT String IO a -> IO a
59run :: ErrorT String IO a -> IO a
40run command = do
60run command = do