Fix hardcoded repository path in the scp call

This commit is contained in:
Eugen Wissner 2023-10-26 19:40:47 +02:00
parent 58a1b8864c
commit 6c0e2c2d24
2 changed files with 14 additions and 4 deletions

View File

@ -273,7 +273,15 @@ updatePackageIfRequired package@Package{..} version = do
Text.IO.putStrLn Text.IO.putStrLn
$ name <> " is up to date (Version " <> version <> ")." $ name <> " is up to date (Version " <> version <> ")."
setSGR [Reset] setSGR [Reset]
| otherwise -> updatePackage package parsedInfoFile version | otherwise -> do
liftIO $ do
setSGR [SetColor Foreground Dull Yellow]
Text.IO.putStrLn
$ "A new version of "
<> name <> " " <> getField @"version" parsedInfoFile
<> " is available (" <> version <> ")."
setSGR [Reset]
updatePackage package parsedInfoFile version
Left errorBundle -> liftIO $ putStr $ errorBundlePretty errorBundle Left errorBundle -> liftIO $ putStr $ errorBundlePretty errorBundle
updateDownload :: Package -> Package.Updater -> SlackBuilderT (URI, Digest MD5) updateDownload :: Package -> Package.Updater -> SlackBuilderT (URI, Digest MD5)

View File

@ -121,9 +121,11 @@ remoteFileExists url = hostedSources url
uploadCommand :: Text -> Text -> SlackBuilderT () uploadCommand :: Text -> Text -> SlackBuilderT ()
uploadCommand localPath remotePath' = do uploadCommand localPath remotePath' = do
remoteRoot <- SlackBuilderT $ asks remotePath remoteRoot <- SlackBuilderT $ asks remotePath
liftIO $ callProcess "scp" $ Text.unpack <$> repository' <- SlackBuilderT $ asks repository
[ "slackbuilds/" <> localPath
, remoteRoot <> remotePath' liftIO $ callProcess "scp"
[ repository' </> Text.unpack localPath
, Text.unpack $ remoteRoot <> remotePath'
] ]
cloneAndArchive :: Text -> Text -> FilePath -> Text -> SlackBuilderT () cloneAndArchive :: Text -> Text -> FilePath -> Text -> SlackBuilderT ()