Commit 9bc62d49 authored by Valentin Reis's avatar Valentin Reis
Browse files

more code moved into shakebuild

parent 832d1e59
Pipeline #6180 passed with stages
in 1 minute and 4 seconds
...@@ -10,6 +10,7 @@ import Development.Shake ...@@ -10,6 +10,7 @@ import Development.Shake
import Protolude import Protolude
import Development.Shake.FilePath import Development.Shake.FilePath
import Control.Monad import Control.Monad
import System.Process.Typed
refactCommands = refactCommands =
[ "OrganizeImports Argo.Stack" [ "OrganizeImports Argo.Stack"
...@@ -18,28 +19,31 @@ refactCommands = ...@@ -18,28 +19,31 @@ refactCommands =
, "OrganizeImports Argo.Types" , "OrganizeImports Argo.Types"
] ]
main = shakeArgs shakeOptions $ do main = getArgs >>= deal
phony "clean" $ removeFilesAfter "." ["README.md"] where
deal args
| "ghcid" `elem` args = void $ startProcess $ proc
"ghcid"
[ "--command"
, "cabal new-repl "
<> " --ghc-options=-fno-code"
<> " --ghc-options=-fno-break-on-exception"
<> " --ghc-options=-fno-break-on-error"
<> " --ghc-options=-v1 --ghc-options=-ferror-spans"
, "--restart"
, "argonix.cabal"
, "--restart"
, "default.nix"
, "--restart"
, "shell.nix"
]
| otherwise = runshake
phony "ghcid" runshake = shakeArgs shakeOptions $ do
$ cmd_ Shell phony "clean" $ removeFilesAfter "." ["README.md"]
$ "while true; do "
<> "nix-shell "
<> "--run 'ghcid "
<> "--command \"cabal repl --ghc-options=-fno-code "
<> "--ghc-options=-fno-break-on-exception "
<> "--ghc-options=-fno-break-on-error "
<> "--ghc-options=-v1 --ghc-options=-ferror-spans "
<> "--ghc-options=-j\" "
<> "--restart=argotk.cabal "
<> "--restart=default.nix"
<> "--restart=shell.nix'"
<> "; done"
phony "ht-refact" htRefactAll phony "ht-refact" htRefactAll
phony "brittany" brittany phony "brittany" brittany
phony "codequality" $ htRefactAll >> brittany phony "codequality" $ htRefactAll >> brittany
want ["README.md"] want ["README.md"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment