Merge pull request 'fix key including newline when read from stdin' (#34) from trim-token into main

Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/34
This commit is contained in:
Cyborus 2023-12-19 20:22:41 +00:00
commit bbe5536b4f

View file

@ -36,7 +36,7 @@ impl AuthCommand {
AuthCommand::AddKey { host, user, key } => {
let key = match key {
Some(key) => key,
None => crate::readline("new key: ").await?,
None => crate::readline("new key: ").await?.trim().to_string(),
};
if keys.hosts.get(&user).is_none() {
keys.hosts