diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-08-25 10:30:24 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-08-25 10:30:24 +0200 |
| commit | 2126488066713719e26a1049adb080e68ec124f1 (patch) | |
| tree | c3bdae9dd7a71f4e06666bf125e834f120453794 /app/Main.hs | |
| parent | 6983304b9d11e78ebf5fd21c835dd04c776102f5 (diff) | |
| download | slackbuilder-2126488066713719e26a1049adb080e68ec124f1.tar.gz | |
Implement clone command in the binary
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs index eea4951..654dcf7 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -13,6 +13,7 @@ import qualified Toml import qualified Data.Text as Text import Control.Monad.Trans.Reader (ReaderT(..)) import SlackBuilder.Download +import Text.URI (mkURI) main :: IO () main = do @@ -38,8 +39,12 @@ main = do <$> remoteFileExists urlPath ArchiveCommand repo nameVersion tarball tagPrefix -> cloneAndArchive repo nameVersion tarball tagPrefix >> pure Nothing - DownloadCommand url target -> fmap (Text.pack . show) - <$> download url target + DownloadCommand url target + | Just uri <- mkURI url -> fmap (Text.pack . show) + <$> download uri target + | otherwise -> pure Nothing + CloneCommand repo tarball tagPrefix -> fmap (Text.pack . show) + <$> clone repo tarball tagPrefix chooseTransformFunction (Just "php") = phpTransform chooseTransformFunction (Just "rdiff-backup") = Text.stripPrefix "v" chooseTransformFunction _ = stripPrefix "v" |
