create HOME directory if not exists
This commit is contained in:
parent
16f4dd8829
commit
9a0e8cc9d6
10
posix/clone
10
posix/clone
@ -5,13 +5,21 @@ if [[ ! -z "${DRONE_WORKSPACE}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# if the home directory is not set (which should
|
# 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
|
if [[ -z "${HOME}" ]]; then
|
||||||
echo "HOME directory not set; default to /root"
|
echo "HOME directory not set; default to /root"
|
||||||
export HOME=/root
|
export HOME=/root
|
||||||
fi
|
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
|
# if the netrc enviornment variables exist, write
|
||||||
# the netrc file.
|
# the netrc file.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user