universal-ctags: Add version path segment
… to the download URL.
This commit is contained in:
parent
ec704e267b
commit
7c499bd3f7
2
.hlint.yaml
Normal file
2
.hlint.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
arguments:
|
||||||
|
- -XQuasiQuotes
|
@ -39,7 +39,8 @@ autoUpdatable =
|
|||||||
let ghArguments = GhArguments{ owner = "universal-ctags", name = "ctags", transform = Nothing}
|
let ghArguments = GhArguments{ owner = "universal-ctags", name = "ctags", transform = Nothing}
|
||||||
latest' = latestGitHub ghArguments pure
|
latest' = latestGitHub ghArguments pure
|
||||||
templateTail =
|
templateTail =
|
||||||
[ Package.StaticPlaceholder "/ctags-"
|
[ Package.VersionPlaceholder
|
||||||
|
, Package.StaticPlaceholder "/ctags-"
|
||||||
, Package.VersionPlaceholder
|
, Package.VersionPlaceholder
|
||||||
, Package.StaticPlaceholder ".tar.gz"
|
, Package.StaticPlaceholder ".tar.gz"
|
||||||
]
|
]
|
||||||
@ -56,8 +57,10 @@ autoUpdatable =
|
|||||||
up2Date :: SlackBuilderT ()
|
up2Date :: SlackBuilderT ()
|
||||||
up2Date = for_ autoUpdatable go
|
up2Date = for_ autoUpdatable go
|
||||||
where
|
where
|
||||||
go package@Package{ latest = Package.Updater getLatest _ } =
|
go package = getAndLogLatest package >>= mapM_ (updatePackage package)
|
||||||
getLatest >>= 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 -> Text -> SlackBuilderT ()
|
||||||
updatePackage Package{..} version = do
|
updatePackage Package{..} version = do
|
||||||
|
@ -109,7 +109,7 @@ latestPackagist PackagistArguments{..} = do
|
|||||||
latestText :: TextArguments -> SlackBuilderT (Maybe Text)
|
latestText :: TextArguments -> SlackBuilderT (Maybe Text)
|
||||||
latestText (TextArguments textArguments) = do
|
latestText (TextArguments textArguments) = do
|
||||||
uri <- liftIO $ useHttpsURI <$> mkURI textArguments
|
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
|
pure $ Text.strip . Text.Encoding.decodeASCII . responseBody
|
||||||
<$> packagistResponse
|
<$> packagistResponse
|
||||||
|
@ -21,7 +21,9 @@ common dependencies
|
|||||||
cryptonite >= 0.30,
|
cryptonite >= 0.30,
|
||||||
filepath ^>= 1.4.2,
|
filepath ^>= 1.4.2,
|
||||||
modern-uri ^>= 0.3.6,
|
modern-uri ^>= 0.3.6,
|
||||||
text ^>= 2.0
|
text ^>= 2.0,
|
||||||
|
tomland ^>= 1.3.3,
|
||||||
|
transformers ^>= 0.5.6
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions:
|
default-extensions:
|
||||||
DataKinds
|
DataKinds
|
||||||
@ -34,7 +36,7 @@ common dependencies
|
|||||||
TemplateHaskell
|
TemplateHaskell
|
||||||
TypeApplications
|
TypeApplications
|
||||||
|
|
||||||
library slackbuilder-internal
|
library
|
||||||
import: dependencies
|
import: dependencies
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
SlackBuilder.Config
|
SlackBuilder.Config
|
||||||
@ -42,9 +44,7 @@ library slackbuilder-internal
|
|||||||
SlackBuilder.Trans
|
SlackBuilder.Trans
|
||||||
hs-source-dirs: lib
|
hs-source-dirs: lib
|
||||||
build-depends:
|
build-depends:
|
||||||
exceptions >= 0.10,
|
exceptions >= 0.10
|
||||||
tomland ^>= 1.3.3,
|
|
||||||
transformers ^>= 0.5.6
|
|
||||||
|
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|
||||||
@ -64,6 +64,7 @@ executable slackbuilder
|
|||||||
optparse-applicative ^>= 0.18.1,
|
optparse-applicative ^>= 0.18.1,
|
||||||
process ^>= 1.6.17,
|
process ^>= 1.6.17,
|
||||||
req ^>= 3.13,
|
req ^>= 3.13,
|
||||||
|
slackbuilder,
|
||||||
unordered-containers ^>= 0.2.19,
|
unordered-containers ^>= 0.2.19,
|
||||||
vector ^>= 0.13.0
|
vector ^>= 0.13.0
|
||||||
hs-source-dirs: app
|
hs-source-dirs: app
|
||||||
@ -80,6 +81,6 @@ test-suite slackbuilder-test
|
|||||||
hs-source-dirs: tests
|
hs-source-dirs: tests
|
||||||
build-depends:
|
build-depends:
|
||||||
hspec >= 2.10.9 && < 2.12,
|
hspec >= 2.10.9 && < 2.12,
|
||||||
slackbuilder-internal
|
slackbuilder
|
||||||
|
|
||||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
|
||||||
|
Loading…
Reference in New Issue
Block a user