Allow updater save a function for each download
There are source that can be downloaded as archive, for example cloning repositories with submodules. So how source are downloaded should be changable per download.
This commit is contained in:
@ -17,7 +17,6 @@ import qualified Text.URI as URI
|
||||
import Crypto.Hash (Digest, MD5)
|
||||
import SlackBuilder.Trans
|
||||
import Control.Monad.Catch (MonadThrow)
|
||||
import System.Process (CmdSpec(..))
|
||||
|
||||
-- | Contains information how a package can be updated.
|
||||
data Package = Package
|
||||
@ -25,7 +24,6 @@ data Package = Package
|
||||
, downloaders :: [Updater]
|
||||
, category :: Text
|
||||
, name :: Text
|
||||
, reupload :: Maybe [CmdSpec]
|
||||
}
|
||||
|
||||
-- | Download URI with the MD5 checksum of the target.
|
||||
@ -79,4 +77,7 @@ renderDownloadWithVersion (DownloadTemplate components) version =
|
||||
f VersionPlaceholder = (version <>)
|
||||
|
||||
-- | Function used to get the latest version of a source.
|
||||
data Updater = Updater (SlackBuilderT (Maybe Text)) DownloadTemplate
|
||||
data Updater = Updater
|
||||
{ detectLatest :: SlackBuilderT (Maybe Text)
|
||||
, getVersion :: Text -> Text -> SlackBuilderT (URI, Digest MD5)
|
||||
}
|
||||
|
Reference in New Issue
Block a user