From c94ab57c30834eaf8d3c59ada900ea3e02831793 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Tue, 24 Mar 2020 22:44:07 +0100 Subject: [PATCH] main: don't require directory input to be set --- main.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.sh b/main.sh index 6e15928..17a5d37 100755 --- a/main.sh +++ b/main.sh @@ -12,17 +12,14 @@ if test -z "$playbook"; then exit 1 fi -if test -z "$directory"; then - echo "You need to specify 'directory' input (root Ansible project directory)" - exit 1 -fi - if test -z "$key"; then echo "You need to specify 'key' input (SSH private key)" exit 1 fi -cd "$directory" +if test -n "$directory"; then + cd "$directory" +fi mkdir -p "$HOME/.ssh" echo "$key" > "$HOME/.ssh/id_rsa"