on master help sign in
Get rid of elm binary that lives in elm-compiler
355abe4Evan Czaplicki
elm-compiler.cabal−24
@@ -158,30 +158,6 @@ Library
158 union-find >= 0.2 && < 0.3
158 union-find >= 0.2 && < 0.3
159
159
160
160
161−Executable elm
162− ghc-options:
163− -threaded -O2 -W
164−
165− Hs-Source-Dirs:
166− src
167−
168− Main-is:
169− CommandLineRouter.hs
170−
171− other-modules:
172− Elm.Compiler.Version,
173− Paths_elm_compiler
174−
175− Build-depends:
176− base >=4.2 && <5,
177− aeson >= 0.11,
178− binary >= 0.7.0.0 && < 0.8,
179− directory >= 1.0 && < 2.0,
180− filepath >= 1 && < 2.0,
181− text >= 1 && < 2,
182− process
183−
184−
185Test-Suite compiler-tests
161Test-Suite compiler-tests
186 ghc-options:
162 ghc-options:
187 -O0
163 -O0
src/CommandLineRouter.hsdeleted−84
@@ -1,84 +0,0 @@
1−module Main where
2−
3−import qualified System.Directory as Dir
4−import qualified System.Environment as Env
5−import System.Exit (exitWith)
6−import System.IO (hPutStrLn, stderr, stdin, stdout)
7−import qualified System.Process as Proc
8−import GHC.IO.Encoding (setLocaleEncoding, utf8)
9−
10−import qualified Elm.Compiler.Version as Compiler
11−import qualified Elm.Package as Pkg
12−
13−
14−
15−main :: IO ()
16−main =
17− do setLocaleEncoding utf8
18−
19− allArgs <- Env.getArgs
20− case allArgs of
21− [] ->
22− putStrLn usageMessage
23−
24− ["--version"] ->
25− putStrLn $ Pkg.versionToString Compiler.version
26−
27− ["-v"] ->
28− putStrLn $ Pkg.versionToString Compiler.version
29−
30− command : args ->
31− attemptToRun command args
32−
33−
34−attemptToRun :: String -> [String] -> IO ()
35−attemptToRun command args =
36− do found <- Dir.findExecutable ("elm-" ++ command)
37− case found of
38− Nothing ->
39− hPutStrLn stderr $
40− "Could not find command `" ++ command ++ "`. Maybe there is a typo?\n\n\
41− \Default commands include:\n\n"
42− ++ availableCommands ++
43− "\nWhen you try to run the command `" ++ command ++ "` we actually search for an\n\
44− \ executable named elm-" ++ command ++ ". Are you able to run elm-" ++ command ++ "?\n\
45− \ Is it on your PATH?"
46−
47− Just path ->
48− let createProc =
49− (Proc.proc path args)
50− { Proc.std_in = Proc.UseHandle stdin
51− , Proc.std_out = Proc.UseHandle stdout
52− , Proc.std_err = Proc.UseHandle stderr
53− }
54− in
55− do (_, _, _, handle) <- Proc.createProcess createProc
56− exitWith =<< Proc.waitForProcess handle
57−
58−
59−usageMessage :: String
60−usageMessage =
61− "Elm Platform " ++ Pkg.versionToString Compiler.version ++ " - a way to run all Elm tools\n\
62− \\n\
63− \Usage: elm <command> [<args>]\n\
64− \\n\
65− \Available commands include:\n\n"
66− ++ availableCommands ++
67− "\nYou can learn more about a specific command by running things like:\n\
68− \\n\
69− \ elm make --help\n\
70− \ elm package --help\n\
71− \ elm <command> --help\n\
72− \\n\
73− \In all these cases we are simply running 'elm-<command>' so if you create an\n\
74− \executable named 'elm-foobar' you will be able to run it as 'elm foobar' as\n\
75− \long as it appears on your PATH."
76−
77−
78−availableCommands :: String
79−availableCommands =
80− " make Compile an Elm file or project into JS or HTML\n\
81− \ package Manage packages from <http://package.elm-lang.org>\n\
82− \ reactor Develop with compile-on-refresh and time-travel debugging\n\
83− \ repl A REPL for running individual expressions\n"
84−