mirror of
https://github.com/anoma/juvix.git
synced 2025-01-05 22:46:08 +03:00
807b3b1770
This PR adds some maintenance at different levels to the CI config, the Make file, and formatting. - Most of the actions used by the CI related to haskell, ormolu, hlint and pre-commit have been updated because Github requires NodeJS 16. This change removes all the old warnings related to nodeJs. In the case of ormolu, the new version makes us format some files that were not formatted before, similarly with hlint. - The CI has been updated to use the latest version of the Smoke testing framework, which introduced installation of the dependencies for Linux (libicu66) and macOS (icu4c) in the CI. In the case of macOS, the CI uses a binary for smoke. For Linux, we use stack to build smoke from the source. The source here is in a fork of [the official Smoke repo](https://github.com/SamirTalwar/smoke). Such includes some features/changes that are not yet in the official repo. - The Makefile runs the ormolu and hlint targets using as a path for the binaries the environment variables ORMOLU and HLINT. Thus, export those variables in your environment before running `make check,` `make format` or `make hlint`. Otherwise, the Makefile will use the binaries provided by `stack`. Co-authored-by: Paul Cadman <git@paulcadman.dev>
34 lines
1.1 KiB
Haskell
34 lines
1.1 KiB
Haskell
module TopCommand where
|
|
|
|
import Commands.Base
|
|
import Commands.Compile qualified as Compile
|
|
import Commands.Dev qualified as Dev
|
|
import Commands.Doctor qualified as Doctor
|
|
import Commands.Html qualified as Html
|
|
import Commands.Init qualified as Init
|
|
import Commands.Repl qualified as Repl
|
|
import Commands.Typecheck qualified as Typecheck
|
|
import Juvix.Extra.Version
|
|
import System.Environment (getProgName)
|
|
import TopCommand.Options
|
|
|
|
showHelpText :: IO ()
|
|
showHelpText = do
|
|
let p = prefs showHelpOnEmpty
|
|
progn <- getProgName
|
|
let helpText = parserFailure p descr (ShowHelpText Nothing) []
|
|
(msg, _) = renderFailure helpText progn
|
|
putStrLn (pack msg)
|
|
|
|
runTopCommand :: forall r. (Members '[Embed IO, App] r) => TopCommand -> Sem r ()
|
|
runTopCommand = \case
|
|
DisplayVersion -> embed runDisplayVersion
|
|
DisplayHelp -> embed showHelpText
|
|
Doctor opts -> runLogIO (Doctor.runCommand opts)
|
|
Init -> runLogIO Init.init
|
|
Dev opts -> Dev.runCommand opts
|
|
Typecheck opts -> Typecheck.runCommand opts
|
|
Compile opts -> Compile.runCommand opts
|
|
Html opts -> Html.runCommand opts
|
|
JuvixRepl opts -> Repl.runCommand opts
|