diff options
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Main.hs b/app/Main.hs index ac1aae2..7e821e5 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -6,14 +6,23 @@ import qualified Data.Text.IO as Text.IO import Data.Maybe (fromMaybe) import Options.Applicative (execParser) import SlackBuilder.CommandLine +import SlackBuilder.Config import SlackBuilder.Updater +import qualified Toml +import qualified Data.Text as Text main :: IO () main = do programCommand <- execParser slackBuilderParser + settings <- Toml.decodeFile settingsCodec "config/config.toml" latestVersion <- case programCommand of PackagistCommand packagistArguments -> latestPackagist packagistArguments TextCommand textArguments -> latestText textArguments + GhCommand ghArguments -> latestGitHub settings ghArguments (stripPrefix "v") Text.IO.putStrLn $ fromMaybe "" latestVersion + where + stripPrefix prefix string = Just + $ fromMaybe string + $ Text.stripPrefix prefix string |
