Skip to content

Commit

Permalink
[aura] Less lifting, bro
Browse files Browse the repository at this point in the history
  • Loading branch information
fosskers committed Apr 23, 2020
1 parent fa5549c commit e6ee489
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion aura/exec/aura.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ displayOutputLanguages :: RIO Env ()
displayOutputLanguages = do
ss <- asks settings
notify ss displayOutputLanguages_1
liftIO $ traverse_ (putTextLn . tshow) [English ..]
traverse_ (putTextLn . tshow) [English ..]

viewConfFile :: RIO Env ()
viewConfFile = do
Expand Down
4 changes: 2 additions & 2 deletions aura/lib/Aura/Commands/A.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ aurPkgInfo :: NonEmpty PkgName -> RIO Env ()
aurPkgInfo = aurInfo >=> traverse_ displayAurPkgInfo

displayAurPkgInfo :: AurInfo -> RIO Env ()
displayAurPkgInfo ai = asks settings >>= \ss -> liftIO . putTextLn $ renderAurPkgInfo ss ai <> "\n"
displayAurPkgInfo ai = asks settings >>= \ss -> putTextLn $ renderAurPkgInfo ss ai <> "\n"

renderAurPkgInfo :: Settings -> AurInfo -> Text
renderAurPkgInfo ss ai = dtot . colourCheck ss $ entrify ss fields entries
Expand Down Expand Up @@ -152,7 +152,7 @@ aurPkgSearch regex = do
Tail n -> reverse . take (fromIntegral n) . reverse
results <- fmap (\x -> (x, aurNameOf x `S.member` db)) . t
<$> aurSearch regex
liftIO $ traverse_ (putTextLn . renderSearch ss regex) results
traverse_ (putTextLn . renderSearch ss regex) results

renderSearch :: Settings -> Text -> (AurInfo, Bool) -> Text
renderSearch ss r (i, e) = searchResult
Expand Down
4 changes: 2 additions & 2 deletions aura/lib/Aura/Commands/C.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ searchCache :: Text -> RIO Env ()
searchCache ps = do
ss <- asks settings
matches <- liftIO $ cacheMatches ss ps
liftIO . traverse_ (putTextLn . T.pack . ppPath) $ L.sort matches
traverse_ (putTextLn . T.pack . ppPath) $ L.sort matches

-- | The destination folder must already exist for the back-up to begin.
backupCache :: FilePath -> RIO Env ()
Expand All @@ -96,7 +96,7 @@ backup :: FilePath -> Cache -> RIO Env ()
backup dir (Cache cache) = do
ss <- asks settings
notify ss backupCache_8
liftIO $ putTextLn "" -- So that the cursor can rise at first.
putTextLn "" -- So that the cursor can rise at first.
copyAndNotify dir (M.elems cache) 1

-- | Manages the file copying and display of the real-time progress notifier.
Expand Down
2 changes: 1 addition & 1 deletion aura/lib/Aura/Commands/L.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ logInfoOnPkg pkgs = do
logFile <- Log . T.lines . decodeUtf8Lenient <$> readFileBinary pth
let (bads, goods) = fmapEither (logLookup logFile) $ toList pkgs
traverse_ (report red reportNotInLog_1) $ NEL.nonEmpty bads
liftIO . traverse_ putTextLn $ map (renderEntry ss) goods
traverse_ (putTextLn . renderEntry ss) goods

logLookup :: Log -> PkgName -> Either PkgName LogEntry
logLookup (Log lns) p = case matches of
Expand Down
2 changes: 1 addition & 1 deletion aura/lib/Aura/Dependencies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resolveDeps repo ps = do
ss <- asks settings
res <- liftIO $ (Just <$> resolveDeps' ss repo ps) `catchAny` const (pure Nothing)
Resolution m s <- maybe (throwM $ Failure connectFailure_1) pure res
unless (length ps == length m) $ liftIO (putText "\n")
unless (length ps == length m) $ putText "\n"
let de = conflicts ss m s
unless (null de) . throwM . Failure $ missingPkg_2 de
either throwM pure $ sortInstall m
Expand Down

0 comments on commit e6ee489

Please sign in to comment.