Skip to content

Commit

Permalink
[#124] Print directories bold (#127)
Browse files Browse the repository at this point in the history
* Print directories bold

* Fix style

* Remove refuses

* Remove line

* Refactor

* Minor fix for output
  • Loading branch information
willbasky authored and chshersh committed Aug 16, 2018
1 parent aefa6b8 commit d05b90c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
Bump up dependencies
* [#58](https://github.com/kowainik/summoner/issues/58):
Make `Licence` type safer
* [#124](https://github.com/kowainik/summoner/issues/124):
Print directories bold

1.0.6
=====
Expand Down
4 changes: 2 additions & 2 deletions src/Summoner/Question.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ targetMessage result target = targetMessageWithText result target "added to the
targetMessageWithText :: Bool -> Text -> Text -> IO Bool
targetMessageWithText result target text = do
let (color, actionResult) = if result
then (Green, " will be " <> text)
else (Cyan, " won't be" <> text)
then (Green, " will be " <> text)
else (Cyan, " won't be " <> text)

beautyPrint [italic, bold, setColor color] $ " " <> headToUpper target
beautyPrint [setColor color] actionResult
Expand Down
8 changes: 7 additions & 1 deletion src/Summoner/Tree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Summoner.Tree

import Relude

import System.Console.ANSI (ConsoleIntensity (BoldIntensity), SGR (..), setSGRCode)
import System.Directory (createDirectoryIfMissing, withCurrentDirectory)

-- | Describes simple structure of filesystem tree.
Expand Down Expand Up @@ -35,7 +36,12 @@ showOne leader tie arm (Dir fp (sortWith treeFp -> trees)) =
nodeRep : showChildren trees (leader <> extension)
where
nodeRep :: Text
nodeRep = leader <> arm <> tie <> toText fp
nodeRep = leader <> arm <> tie <> boldDir (fp <> "/")
where
boldDir str = toText
$ setSGRCode [SetConsoleIntensity BoldIntensity]
<> str
<> setSGRCode [Reset]

extension :: Text
extension = case arm of "" -> ""; "" -> " "; _ -> ""
Expand Down
2 changes: 1 addition & 1 deletion summoner.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: summoner
version: 1.0.6
version: 1.0.7
synopsis: Tool for creating completely configured production Haskell projects.
description: Tool for creating completely configured production Haskell projects.
See README.md for details.
Expand Down

0 comments on commit d05b90c

Please sign in to comment.