2module Build.Utils where
4import Control.Monad.Error
5import System.Directory (doesFileExist)
6import System.Environment (getEnv)
7import System.FilePath ((</>), replaceExtension)
8import qualified Build.Flags as Flag
9import qualified Build.Print as Print
10import qualified Paths_Elm as This
12buildPath :: Flag.Flags -> FilePath -> String -> FilePath
13buildPath flags filePath ext =
14 Flag.build_dir flags </> replaceExtension filePath ext
16cachePath :: Flag.Flags -> FilePath -> String -> FilePath
17cachePath flags filePath ext =
18 Flag.cache_dir flags </> replaceExtension filePath ext
20elmo :: Flag.Flags -> FilePath -> FilePath
22 cachePath flags filePath "elmo"
24elmi :: Flag.Flags -> FilePath -> FilePath
26 cachePath flags filePath "elmi"
28-- |The absolute path to a data file
29getDataFile :: FilePath -> IO FilePath
31 path <- This.getDataFileName name
32 exists <- doesFileExist path
36 env <- getEnv "ELM_HOME"
39run :: ErrorT String IO a -> IO a
41 either <- runErrorT command
43 Left err -> Print.failure err
44 Right result -> return result
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list