From 8ccda8e12476d127fe5ad71d3e64b9bebdfcd49b Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Nov 2022 10:45:11 +0800 Subject: [PATCH] Do not auto-generate keys --- app/Foliage/CmdBuild.hs | 7 +++++-- app/Foliage/Options.hs | 19 ++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Foliage/CmdBuild.hs b/app/Foliage/CmdBuild.hs index f3a206f..aa69558 100644 --- a/app/Foliage/CmdBuild.hs +++ b/app/Foliage/CmdBuild.hs @@ -63,8 +63,11 @@ buildAction SignOptsSignWithKeys keysPath -> do ks <- doesDirectoryExist keysPath unless ks $ do - putWarn $ "You don't seem to have created a set of TUF keys. I will create one in " <> keysPath - liftIO $ createKeys keysPath + putError $ unwords + [ "I cannot find a set of TUF keys in " <> keysPath <> "," + , "Use the create-keys command to create them." + ] + fail "Keys not found" return $ \name -> readKeysAt (keysPath name) SignOptsDon'tSign -> return $ const $ return [] diff --git a/app/Foliage/Options.hs b/app/Foliage/Options.hs index 010da20..58813f3 100644 --- a/app/Foliage/Options.hs +++ b/app/Foliage/Options.hs @@ -93,17 +93,14 @@ buildCommand = ) where signOpts = - ( SignOptsSignWithKeys - <$> strOption - ( long "keys" - <> metavar "KEYS" - <> help "TUF keys location" - <> showDefault - <> value "_keys" - ) - ) - <|> ( SignOptsDon'tSign - <$ switch (long "no-signatures" <> help "Don't sign the repository") + pure SignOptsDon'tSign + <|> ( SignOptsSignWithKeys + <$> strOption + ( long "sign-with-keys" + <> metavar "KEYS" + <> help "TUF keys location" + <> value "_keys" + ) ) createKeysCommand :: Parser Command