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

[#48] Add configurations, read from the file #59

Merged
merged 5 commits into from
May 25, 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
Fixes
  • Loading branch information
vrom911 committed May 25, 2018
commit aebce9b17145333cf79b2c3d0a338ffd83708070
7 changes: 4 additions & 3 deletions src/Summoner/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ runWithOptions (InitOpts projectName cliConfig maybeFile) = do
then do
infoMessage $ "Configurations from " <> T.pack file <> " will be used."
loadFileConfig file
else if isDefault
else if isDefault
then do
warningMessage "Default config file is missing."
fp <- T.pack <$> defaultConfigFile
warningMessage $ "Default config " <> fp <> " file is missing."
pure mempty
else do
errorMessage $ "Specified configuration file " <> T.pack file <> " is not found."
Expand All @@ -59,7 +60,7 @@ runWithOptions (InitOpts projectName cliConfig maybeFile) = do
-- get the final config
finalConfig <- case finalise unionConfig of
Failure msgs -> do
for_ msgs $ \msg -> errorMessage msg
for_ msgs errorMessage
exitFailure
Success c -> pure c
-- Generate the project.
Expand Down
3 changes: 1 addition & 2 deletions src/Summoner/Question.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ queryDef question defAnswer = do
| otherwise -> pure answer

queryManyRepeatOnFail :: forall a . (Text -> Maybe a) -> IO [a]
queryManyRepeatOnFail parser = do
promptLoop
queryManyRepeatOnFail parser = promptLoop
where
promptLoop :: IO [a]
promptLoop = do
Expand Down