Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#96] Add option to choose cabal or stack or both #106

Merged
merged 3 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix review comments
  • Loading branch information
vrom911 committed Jul 17, 2018
commit 6a0b8ef82bf9931482bc50c6817a31322dae7722
2 changes: 1 addition & 1 deletion src/Summoner/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ finalise Config{..} = Config
<*> fin "fullName" cFullName
<*> fin "email" cEmail
<*> fin "license" cLicense
<*> fin "ghcersions" cGhcVer
<*> fin "ghcVersions" cGhcVer
<*> pure cCabal
<*> pure cStack
<*> pure cGitHub
Expand Down
6 changes: 2 additions & 4 deletions src/Summoner/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ generateProject projectName Config{..} = do
-- Library/Executable/Tests/Benchmarks flags
github <- decisionToBool cGitHub "GitHub integration"
travis <- ifGithub github "Travis CI integration" cTravis
appVey <- let appTar = "AppVeyor CI integration" in
if stack then ifGithub github appTar cAppVey
else falseMessage appTar
appVey <- ifGithub (stack && github) "AppVeyor CI integration" cAppVey
privat <- ifGithub github "private repository" cPrivate
script <- decisionToBool cScript "build script"
isLib <- decisionToBool cLib "library target"
Expand Down Expand Up @@ -179,7 +177,7 @@ generateProject projectName Config{..} = do
(Idk, Idk) -> decisionToBool cCabal "cabal" >>= \c ->
if c then decisionToBool cStack "stack" >>= \s -> pure (c, s)
else stackMsg True >> pure (False, True)
(Nop, Nop) -> errorMessage "Neither cabal nor stack was choosen" >> exitFailure
(Nop, Nop) -> errorMessage "Neither cabal nor stack was chosen" >> exitFailure
(Yes, Yes) -> output (True, True)
(Yes, _) -> output (True, False)
(_, Yes) -> output (False, True)
Expand Down