Improve add-release-channel, fixes #708

This commit is contained in:
Julian Ospald 2022-12-20 00:57:56 +08:00
parent d195a3f86c
commit e8586cf993
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F

View File

@ -188,9 +188,15 @@ config configCommand settings keybindings runLogger = case configCommand of
AddSource xs -> do
doConfig (defaultUserSettings { uUrlSource = Just $ AddSource (xs <> [Right uri]) })
pure ExitSuccess
_ -> do
GHCupURL -> do
doConfig (defaultUserSettings { uUrlSource = Just $ AddSource [Right uri] })
pure ExitSuccess
OwnSource xs -> do
doConfig (defaultUserSettings { uUrlSource = Just $ OwnSource (xs <> [Right uri]) })
pure ExitSuccess
OwnSpec spec -> do
doConfig (defaultUserSettings { uUrlSource = Just $ OwnSource ([Left spec, Right uri]) })
pure ExitSuccess
where
doConfig :: MonadIO m => UserSettings -> m ()