Skip to content

Commit

Permalink
main: don't require directory input to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Mar 24, 2020
1 parent 7294666 commit c94ab57
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c94ab57

Please sign in to comment.