-
-
Notifications
You must be signed in to change notification settings - Fork 75
[#114] Add non-interactive mode for summoner
#421
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
[#114] Add non-interactive mode for summoner
#421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why your PR is still not approved? Because I chose not to approve it. But they will.
523bb1c
to
6beac3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extremely nice refactoring! I like how a lot of functions were moved into the library and reused 👍
libraryP d = flag Idk d $ mconcat | ||
[ long "library" | ||
, short 'l' | ||
, help "Library folder" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactoring with CLI options!
-- | Switcher for non-interactive mode. | ||
data Interactivity | ||
= Interactive | ||
| NonInteractive | ||
deriving stock (Show, Eq) | ||
|
||
-- | Is interactivity mode 'NonInteractive'? | ||
isNonInteractive :: Interactivity -> Bool | ||
isNonInteractive = \case | ||
NonInteractive -> True | ||
Interactive -> False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already like this module 😍 Nice idea to use enums instead of booleans 👍
could be. | ||
-} | ||
|
||
module Summoner.Mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also reexport this module from Summoner.hs
summoner-tui/src/Summoner/Tui.hs
Outdated
year <- currentYear | ||
guessConfig <- guessConfigFromGit | ||
lc <- fetchLicenseCustom | ||
licenseName | ||
(fromMaybe "YOUR NAME" $ getLast $ cFullName guessConfig) | ||
year |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these lines can be moved into a separate function that returns IO License
. And then you can reuse them in both CLI and TUI files.
Co-Authored-By: Dmitrii Kovanikov <kovanikov@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
Resolves #114