Commit 5dc91386 authored by Alexis Williams's avatar Alexis Williams
Browse files

Fix code clean-up error

parent dbffa512
...@@ -253,9 +253,15 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, newInstal ...@@ -253,9 +253,15 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, newInstal
Just (pkgId :: PackageId) Just (pkgId :: PackageId)
| pkgVersion pkgId /= nullVersion -> Right pkgId | pkgVersion pkgId /= nullVersion -> Right pkgId
_ -> Left str _ -> Left str
packageSpecifiers = flip fmap packageIds $ \case
PackageIdentifier{..}
| pkgVersion == nullVersion -> NamedPackage pkgName []
| otherwise ->
NamedPackage pkgName [PackagePropertyVersion (thisVersion pkgVersion)]
packageTargets = flip TargetPackageNamed Nothing . pkgName <$> packageIds
if null targetStrings' if null targetStrings'
then then return (packageSpecifiers, packageTargets, projectConfig localBaseCtx)
return (packageSpecifiers, packageTargets, projectConfig localBaseCtx)
else do else do
targetSelectors <- either (reportTargetSelectorProblems verbosity) return targetSelectors <- either (reportTargetSelectorProblems verbosity) return
=<< readTargetSelectors (localPackages localBaseCtx) targetStrings' =<< readTargetSelectors (localPackages localBaseCtx) targetStrings'
...@@ -338,14 +344,6 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, newInstal ...@@ -338,14 +344,6 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, newInstal
then return (hackagePkgs, hackageTargets) then return (hackagePkgs, hackageTargets)
else return (local ++ hackagePkgs, targets' ++ hackageTargets) else return (local ++ hackagePkgs, targets' ++ hackageTargets)
let
packageSpecifiers = flip fmap packageIds $ \case
PackageIdentifier{..}
| pkgVersion == nullVersion -> NamedPackage pkgName []
| otherwise ->
NamedPackage pkgName [PackagePropertyVersion (thisVersion pkgVersion)]
packageTargets = flip TargetPackageNamed Nothing . pkgName <$> packageIds
return (specs ++ packageSpecifiers, selectors ++ packageTargets, projectConfig localBaseCtx) return (specs ++ packageSpecifiers, selectors ++ packageTargets, projectConfig localBaseCtx)
withoutProject = do withoutProject = do
......
Supports Markdown
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