diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-10-26 19:40:47 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-10-26 19:40:47 +0200 |
| commit | 6c0e2c2d24f380e5bdf6f1fce36ea7ee11afe6ea (patch) | |
| tree | 0f257be8b5da19f3e9c7845fd76fc2cd8a335154 | |
| parent | 58a1b8864cf1ba68a12e1ba7dc2e407903ce5992 (diff) | |
| download | slackbuilder-6c0e2c2d24f380e5bdf6f1fce36ea7ee11afe6ea.tar.gz | |
Fix hardcoded repository path in the scp call
| -rw-r--r-- | app/Main.hs | 10 | ||||
| -rw-r--r-- | app/SlackBuilder/Download.hs | 8 |
2 files changed, 14 insertions, 4 deletions
diff --git a/app/Main.hs b/app/Main.hs index 9d3da09..5954918 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -273,7 +273,15 @@ updatePackageIfRequired package@Package{..} version = do Text.IO.putStrLn $ name <> " is up to date (Version " <> version <> ")." 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 updateDownload :: Package -> Package.Updater -> SlackBuilderT (URI, Digest MD5) diff --git a/app/SlackBuilder/Download.hs b/app/SlackBuilder/Download.hs index d5bd7e8..011def7 100644 --- a/app/SlackBuilder/Download.hs +++ b/app/SlackBuilder/Download.hs @@ -121,9 +121,11 @@ remoteFileExists url = hostedSources url uploadCommand :: Text -> Text -> SlackBuilderT () uploadCommand localPath remotePath' = do remoteRoot <- SlackBuilderT $ asks remotePath - liftIO $ callProcess "scp" $ Text.unpack <$> - [ "slackbuilds/" <> localPath - , remoteRoot <> remotePath' + repository' <- SlackBuilderT $ asks repository + + liftIO $ callProcess "scp" + [ repository' </> Text.unpack localPath + , Text.unpack $ remoteRoot <> remotePath' ] cloneAndArchive :: Text -> Text -> FilePath -> Text -> SlackBuilderT () |
