hercules-ci-cli 0.3.3 → 0.3.4
raw patch · 4 files changed
+14/−4 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- hercules-ci-cli.cabal +1/−1
- src/Hercules/CLI/Credentials.hs +1/−1
- src/Hercules/CLI/State.hs +6/−2
CHANGELOG.md view
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.3.4 - 2022-12-02++### Added++ - `hci state get --version INT` added, to retrieve a specific revision of a remote state file.+ ## 0.3.3 - 2022-11-15 ### Added
hercules-ci-cli.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 name: hercules-ci-cli-version: 0.3.3+version: 0.3.4 synopsis: The hci command for working with Hercules CI homepage: https://docs.hercules-ci.com bug-reports: https://github.com/hercules-ci/hercules-ci-agent/issues
src/Hercules/CLI/Credentials.hs view
@@ -8,7 +8,7 @@ import Control.Monad.Trans.Maybe (MaybeT (MaybeT, runMaybeT)) import Data.Aeson (FromJSON, ToJSON, eitherDecode) import qualified Data.Aeson as A-import Data.Aeson.Lens (AsPrimitive (_String), key)+import Data.Aeson.Lens (key, _String) import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BL import qualified Data.Map as M
src/Hercules/CLI/State.hs view
@@ -12,7 +12,7 @@ import Hercules.CLI.Common (runAuthenticated) import Hercules.CLI.Options (mkCommand, subparser) import Hercules.CLI.Project (ProjectPath (projectPathOwner, projectPathProject, projectPathSite), findProjectContextually, projectOption)-import Options.Applicative (bashCompleter, completer, help, long, metavar, strOption)+import Options.Applicative (auto, bashCompleter, completer, help, long, metavar, option, strOption) import qualified Options.Applicative as Optparse import Protolude hiding (option) import RIO (RIO, runRIO, withBinaryFile)@@ -37,11 +37,12 @@ projectMaybe <- optional projectOption name <- nameOption file <- fileOption+ versionMaybe <- optional versionOption pure do runAuthenticated do projectStateClient <- getProjectAndClient projectMaybe -- TODO: version- runHerculesClientStream (getStateData projectStateClient name Nothing) \case+ runHerculesClientStream (getStateData projectStateClient name versionMaybe) \case Left e -> dieWithHttpError e Right (Headers r _) -> do runConduitRes $@@ -72,6 +73,9 @@ fileOption :: Optparse.Parser FilePath fileOption = strOption $ long "file" <> metavar "FILE" <> help "Local path of the state file or - for stdio" <> completer (bashCompleter "file")++versionOption :: Optparse.Parser Int+versionOption = option auto $ long "version" <> metavar "INT" <> help "Version of the state file to retrieve" getProjectAndClient :: (Has HerculesClientToken r, Has HerculesClientEnv r) => Maybe ProjectPath -> RIO r (ProjectStateResourceGroup ClientAuth (AsClientT ClientM)) getProjectAndClient projectMaybe =