diff options
author | Simponic <loganhunt@simponic.xyz> | 2023-01-02 19:10:23 -0700 |
---|---|---|
committer | Simponic <loganhunt@simponic.xyz> | 2023-01-02 19:10:23 -0700 |
commit | 16281b0e8deb6b3bf86ac0b9381f3fdf89b22b58 (patch) | |
tree | 80295ecaaad54c82ea1541d0932f8e8043f88515 /lib/chessh/schema | |
parent | 2bf058d5db79cc75f87d9accfeb9773d5bf29686 (diff) | |
download | chessh-16281b0e8deb6b3bf86ac0b9381f3fdf89b22b58.tar.gz chessh-16281b0e8deb6b3bf86ac0b9381f3fdf89b22b58.zip |
Now a simple logo draws in the center of the terminal, terminal size is limited, and resizing support
Diffstat (limited to 'lib/chessh/schema')
-rw-r--r-- | lib/chessh/schema/key.ex | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/chessh/schema/key.ex b/lib/chessh/schema/key.ex index adf018d..df790e2 100644 --- a/lib/chessh/schema/key.ex +++ b/lib/chessh/schema/key.ex @@ -20,14 +20,6 @@ defmodule Chessh.Key do |> validate_format(:key, ~r/^(?!ssh-dss).+/, message: "DSA keys are not supported") end - defp update_encode_key(attrs, field) do - if Map.has_key?(attrs, field) do - Map.update!(attrs, field, &encode_key/1) - else - attrs - end - end - def encode_key(key) do if is_tuple(key) do case key do @@ -39,8 +31,15 @@ defmodule Chessh.Key do else key end - # Remove comment at end of key |> String.replace(~r/ [^ ]+\@[^ ]+$/, "") |> String.trim() end + + defp update_encode_key(attrs, field) do + if Map.has_key?(attrs, field) do + Map.update!(attrs, field, &encode_key/1) + else + attrs + end + end end |