diff --git a/skeleton/wrapper.sh b/skeleton/wrapper.sh index e661d30..10b78ae 100644 --- a/skeleton/wrapper.sh +++ b/skeleton/wrapper.sh @@ -1,4 +1,12 @@ #!/bin/bash +if [ -z "${HOME}" ]; then + if [ "$(whoami)" == "root" ]; then + HOME="/root" + else + HOME=$(grep "$(whoami)" /etc/passwd | awk 'BEGIN {FS=":"} {print($6)}') + fi +fi + CONFIG_FILE="${HOME}/.config/__project_codename__.conf" cd "__src_folder__" || exit 1 if [ -r "${CONFIG_FILE}" ]; then