Support a custom upload command
All checks were successful
Build / audit (push) Successful in 13m47s
Build / test (push) Successful in 14m16s

This commit is contained in:
2024-05-11 19:01:41 +02:00
parent 6ba319c3b6
commit f8ef93fde7
4 changed files with 27 additions and 24 deletions

View File

@ -172,7 +172,7 @@ reuploadWithTemplate downloadTemplate commands packagePath version = do
download' <- handleReupload relativeTarball' downloadFileName
pure $ Package.Download download' checksum
where
name' = Text.pack $ takeBaseName $ Text.unpack packagePath
category' = Text.pack $ takeBaseName $ Text.unpack packagePath
prepareSource tarballPath =
liftIO (traverse (defaultCreateProcess tarballPath) commands)
>> liftIO (tarCompress tarballPath)
@ -190,8 +190,8 @@ reuploadWithTemplate downloadTemplate commands packagePath version = do
downloadURL' <- SlackBuilderT $ asks downloadURL
liftIO $ putStrLn $ "Upload the source tarball " <> relativeTarball
uploadCommand relativeTarball ("/" <> name')
liftIO $ mkURI $ downloadURL' <> "/" <> name' <> "/" <> Text.pack downloadFileName
uploadSource relativeTarball category'
liftIO $ mkURI $ downloadURL' <> "/" <> category' <> "/" <> Text.pack downloadFileName
defaultCreateProcess cwd' cmdSpec
= flip withCreateProcess (const . const . const waitForProcess)
$ CreateProcess