From e1e779ce985cc18dfcdec62fa2218eff91581f97 Mon Sep 17 00:00:00 2001 From: Mark D Horn Date: Tue, 5 Mar 2019 10:39:53 -0800 Subject: [PATCH] Ensure HOME is set for post hook as root Even though we are running as a login shell, the HOME is not being set and hence neither is GOCACHE which is required for golang 1.12 and beyond. Signed-off-by: Mark D Horn --- scripts/developer-image-post.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/developer-image-post.sh b/scripts/developer-image-post.sh index 45fbcbd..ae41ff1 100755 --- a/scripts/developer-image-post.sh +++ b/scripts/developer-image-post.sh @@ -3,6 +3,7 @@ DESTDIR=$1 SAVE_DIR=$(pwd) TEMP_INST=$(mktemp -d) +export HOME=$(getent passwd $(id -un) |& awk -F: '{print $(NF-1)}') git clone . ${TEMP_INST} cd ${TEMP_INST} make install DESTDIR=${DESTDIR}