summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2023-09-25 10:18:00 +0200
committerEugen Wissner <belka@caraus.de>2023-09-25 10:18:00 +0200
commit7c499bd3f7140397e4737292c4b87ad9e560fef1 (patch)
treece38557723e52f26a2d708b49624e6542200cac3 /app
parentec704e267b1344ca30654850b7d127198846d081 (diff)
downloadslackbuilder-7c499bd3f7140397e4737292c4b87ad9e560fef1.tar.gz
universal-ctags: Add version path segment
… to the download URL.
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs9
-rw-r--r--app/SlackBuilder/Updater.hs2
2 files changed, 7 insertions, 4 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 46256cc..5b888b4 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -39,7 +39,8 @@ autoUpdatable =
let ghArguments = GhArguments{ owner = "universal-ctags", name = "ctags", transform = Nothing}
latest' = latestGitHub ghArguments pure
templateTail =
- [ Package.StaticPlaceholder "/ctags-"
+ [ Package.VersionPlaceholder
+ , Package.StaticPlaceholder "/ctags-"
, Package.VersionPlaceholder
, Package.StaticPlaceholder ".tar.gz"
]
@@ -56,8 +57,10 @@ autoUpdatable =
up2Date :: SlackBuilderT ()
up2Date = for_ autoUpdatable go
where
- go package@Package{ latest = Package.Updater getLatest _ } =
- getLatest >>= mapM_ (updatePackage package)
+ go package = getAndLogLatest package >>= mapM_ (updatePackage package)
+ getAndLogLatest Package{ latest = Package.Updater getLatest _, name }
+ = liftIO (putStrLn $ Text.unpack name <> ": Retreiving the latest version.")
+ >> getLatest
updatePackage :: Package -> Text -> SlackBuilderT ()
updatePackage Package{..} version = do
diff --git a/app/SlackBuilder/Updater.hs b/app/SlackBuilder/Updater.hs
index 6663bb7..864e466 100644
--- a/app/SlackBuilder/Updater.hs
+++ b/app/SlackBuilder/Updater.hs
@@ -109,7 +109,7 @@ latestPackagist PackagistArguments{..} = do
latestText :: TextArguments -> SlackBuilderT (Maybe Text)
latestText (TextArguments textArguments) = do
uri <- liftIO $ useHttpsURI <$> mkURI textArguments
- packagistResponse <- traverse (runReq defaultHttpConfig) $ go . fst <$> uri
+ packagistResponse <- traverse (runReq defaultHttpConfig . go . fst) uri
pure $ Text.strip . Text.Encoding.decodeASCII . responseBody
<$> packagistResponse