Skip to content

Commit

Permalink
pretty up the last (?) things in s/S/Package.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
kadoban committed Aug 24, 2017
1 parent 8083dc6 commit 0e30e38
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Stack/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,8 +1237,7 @@ hpack pkgDir = do
let hpackFile = pkgDir </> $(mkRelFile Hpack.packageConfig)
exists <- liftIO $ doesFileExist hpackFile
when exists $ do
let fpt = T.pack (toFilePath hpackFile)
$logDebug $ "Running hpack on " <> fpt
$prettyDebugL [flow "Running hpack on", display hpackFile]
#if MIN_VERSION_hpack(0,18,0)
r <- liftIO $ Hpack.hpackResult (Just $ toFilePath pkgDir)
#else
Expand Down Expand Up @@ -1280,10 +1279,13 @@ resolveOrWarn subject resolver path =
dir <- asks (parent . ctxFile)
result <- resolver dir path
when (isNothing result) $
$logWarn ("Warning: " <> subject <> " listed in " <>
T.pack (maybe (FL.toFilePath file) FL.toFilePath (stripProperPrefix cwd file)) <>
" file does not exist: " <>
T.pack path)
$prettyWarnL
[ fromString . T.unpack $ subject -- TODO: needs style?
, flow "listed in"
, maybe (display file) display (stripProperPrefix cwd file)
, flow "file does not exist:"
, styleDir . fromString $ path
]
return result

-- | Resolve the file, if it can't be resolved, warn for the user
Expand Down

0 comments on commit 0e30e38

Please sign in to comment.