Replace extern rm rf call with a function
All checks were successful
Build / audit (push) Successful in 13m18s
Build / test (push) Successful in 14m23s

This commit is contained in:
2024-05-14 19:05:41 +02:00
parent 3b7b15f381
commit c81cabfcbf
2 changed files with 19 additions and 20 deletions

View File

@ -61,13 +61,10 @@ import System.Console.ANSI
, Color(..)
, ConsoleLayer(..)
)
import Control.Monad (filterM, void)
import Control.Monad (filterM)
import Data.List (isPrefixOf, isSuffixOf, partition)
import Conduit (runConduitRes, (.|), yield)
import Data.Functor ((<&>))
import Data.Bifunctor (Bifunctor(..))
import Data.Conduit.Tar (tarFilePath)
import qualified Data.Conduit.Lzma as Lzma
getAndLogLatest :: PackageDescription -> SlackBuilderT (Maybe PackageUpdateData)
getAndLogLatest description = do
@ -182,10 +179,7 @@ reuploadWithTemplate downloadTemplate commands packagePath version = do
appendTarExtension = (<.> "tar.xz")
in fmap (appendTarExtension tarballPath,)
$ withCurrentDirectory (takeDirectory tarballPath)
$ runConduitRes $ yield archiveBaseFilename
.| void tarFilePath
.| Lzma.compress Nothing
.| sinkFileAndHash (appendTarExtension archiveBaseFilename)
$ createLzmaTarball archiveBaseFilename archiveBaseFilename
handleReupload relativeTarball = do
liftIO $ putStrLn $ "Upload the source tarball " <> relativeTarball
uploadSource relativeTarball category'