From c09256897154fba40911a98e88e559d595c56293 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 14 Nov 2021 01:36:59 +0000 Subject: [PATCH] chore(ssh-pubkey): style update --- ssh-pubkey/install.sh | 9 +++++---- ssh-utils/ssh-pubkey.sh | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ssh-pubkey/install.sh b/ssh-pubkey/install.sh index db9dc3f..dc71cba 100644 --- a/ssh-pubkey/install.sh +++ b/ssh-pubkey/install.sh @@ -1,9 +1,8 @@ #!/bin/bash +set -e +set -u -{ - set -e - set -u - +function __install_ssh_pubkey() { MY_CMD="ssh-pubkey" rm -f "$HOME/.local/bin/$MY_CMD" @@ -13,3 +12,5 @@ # run the command "$HOME/.local/bin/$MY_CMD" } + +__install_ssh_pubkey diff --git a/ssh-utils/ssh-pubkey.sh b/ssh-utils/ssh-pubkey.sh index d15cac5..40b09fa 100644 --- a/ssh-utils/ssh-pubkey.sh +++ b/ssh-utils/ssh-pubkey.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e +set -u -{ - set -e - set -u +function _ssh_pubkey() { if [ ! -d "$HOME/.ssh" ]; then mkdir -p "$HOME/.ssh/" @@ -32,6 +32,7 @@ # TODO use the comment (if any) for the name of the file echo >&2 "" + #shellcheck disable=SC2088 echo >&2 "~/Downloads/id_rsa.$(whoami).pub": echo >&2 "" rm -f "$HOME/Downloads/id_rsa.$(whoami).pub" @@ -39,3 +40,5 @@ cat "$HOME/Downloads/id_rsa.$(whoami).pub" echo >&2 "" } + +_ssh_pubkey -- 2.25.1