diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-09-21 23:51:02 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-09-21 23:51:02 +0200 |
| commit | a7114618c1290b00745db69ef0e60b2e848a662d (patch) | |
| tree | 40f49cf43c7f443b5e01505d36474c0f3514ba48 /app/Main.hs | |
| parent | 77c9a2ab54b697f37e21b76c1fd82fc42dc4792e (diff) | |
| download | slackbuilder-a7114618c1290b00745db69ef0e60b2e848a662d.tar.gz | |
Combine test and application dependencies
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/Main.hs b/app/Main.hs index 51681b5..46256cc 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -22,6 +22,7 @@ import Text.URI.QQ (uri) import Data.Foldable (for_) import qualified Text.URI as URI import GHC.Records (HasField(..)) +import System.FilePath ((</>), (<.>)) data Package = Package { latest :: Package.Updater @@ -77,12 +78,20 @@ updatePackage Package{..} version = do uri' <- liftIO $ Package.renderDownloadWithVersion downloadTemplate version let tarball = "slackbuilds/development/universal-ctags/ctags-#{version}.tar.gz" checksum <- fromMaybe undefined <$> download uri' tarball - download' <- liftIO $ mkURI "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{version}.tar.gz" + download' <- liftIO + $ mkURI + $ Text.replace "#{version}" version + "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{version}.tar.gz" + repository' <- SlackBuilderT $ asks repository + let infoFilePath = repository' </> Text.unpack packagePath + </> (Text.unpack name <.> "info") - liftIO $ Text.IO.writeFile "slackbuilds/#{package.path}/#{package.name}.info" + liftIO $ Text.IO.writeFile infoFilePath $ Package.infoTemplate package' [Package.Download download' checksum False] updateSlackBuildVersion packagePath version - uploadCommand (Text.pack tarball) "#{CONFIG[:remote_path]}/universal-ctags" + + remotePath' <- SlackBuilderT $ asks remotePath + uploadCommand (Text.pack tarball) $ remotePath' <> "/universal-ctags" commit packagePath version |
