From 9a0e8cc9d630318eedeff99fa7f9d227f0896e12 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 4 May 2021 21:16:15 -0400 Subject: [PATCH] create HOME directory if not exists --- posix/clone | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/posix/clone b/posix/clone index 8720c0a..6e1b0d6 100755 --- a/posix/clone +++ b/posix/clone @@ -5,13 +5,21 @@ if [[ ! -z "${DRONE_WORKSPACE}" ]]; then fi # if the home directory is not set (which should -# never be the case) we should set to /root +# never be the case) we default to /root if [[ -z "${HOME}" ]]; then echo "HOME directory not set; default to /root" export HOME=/root fi +# if the home directory does not exist it should +# be created. + +if [ ! -d "${HOME}" ]; then + echo "HOME directory does not exist; creating HOME" + mkdir -p ${HOME} +fi + # if the netrc enviornment variables exist, write # the netrc file.