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

Fix #288: allow mixing --local with and without paths when generating #438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
17 changes: 13 additions & 4 deletions src/Action/Generate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,20 @@ actionGenerate g@Generate{..} = withTiming (if debug then Just $ replaceExtensio
warnFlagIgnored "--haddock" "set" (local_ /= []) "--local"
warnFlagIgnored "--haddock" "set" (isJust download) "--download"
readHaskellHaddock timing settings dir
| [""] <- local_ -> do
warnFlagIgnored "--local" "used as flag (no paths)" (isJust download) "--download"
readHaskellGhcpkg timing settings
| [] <- local_ -> do readHaskellOnline timing settings doDownload
| otherwise -> readHaskellDirs timing settings local_
| otherwise -> do
let (localFlag, dirs) = partition (=="") local_
(ghcPkgCbl, ghcPkgWant, ghcPkgSource) <-
if null localFlag
then pure (Map.empty, Set.empty, pure ())
else do
warnFlagIgnored "--local" "used as flag (no paths)" (isJust download) "--download"
readHaskellGhcpkg timing settings
(dirsCbl, dirsWant, dirsSource) <-
if null dirs
then pure (Map.empty, Set.empty, pure ())
else readHaskellDirs timing settings dirs
pure (Map.union dirsCbl ghcPkgCbl, Set.union dirsWant ghcPkgWant, ghcPkgSource >> dirsSource)
Frege | [] <- local_ -> readFregeOnline timing doDownload
| otherwise -> errorIO "No support for local Frege databases"
(cblErrs, popularity) <- evaluate $ packagePopularity cbl
Expand Down