From bc9150b59209ae82b5c3ac2a0c1cebf44ca5397e Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Mon, 14 Aug 2023 21:41:12 -0700 Subject: [PATCH] shellcheck fixes --- install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index af49fc6..d7ebbb2 100755 --- a/install.sh +++ b/install.sh @@ -7,6 +7,7 @@ set -o errexit set -o shwordsplit 2>/dev/null || true # Make zsh behave like bash USER=${USER:-$(id -un)} +HOME=${HOME:-$(cd ~ && pwd)} case $(uname) in Linux) @@ -67,7 +68,7 @@ install_dotfile_dir() { ${submodule_prune} \) \ -prune -o ${FINDTYPE} f -print | \ while read -r dotfile ; do - local TARGET="${HOME}/.${dotfile#${SRCDIR}/}" + local TARGET="${HOME}/.${dotfile#"${SRCDIR}"/}" mkdir -p "$(dirname "${TARGET}")" ln -s -f "${dotfile}" "${TARGET}" done @@ -75,7 +76,7 @@ install_dotfile_dir() { awk '{print $2}' | \ while read -r submodule ; do local FULLNAME="${BASEDIR}/${submodule}" - local TARGET="${HOME}/.${FULLNAME#${SRCDIR}/}" + local TARGET="${HOME}/.${FULLNAME#"${SRCDIR}"/}" mkdir -p "$(dirname "${TARGET}")" if test -L "${TARGET}" ; then if [ "$(readlink "${TARGET}")" != "${FULLNAME}" ] ; then @@ -95,7 +96,7 @@ install_basic_dir() { local file find "${SRCDIR}" ${FINDTYPE} f -print | \ while read -r file ; do - local TARGET="${2}/${file#${SRCDIR}/}" + local TARGET="${2}/${file#"${SRCDIR}"/}" mkdir -p "$(dirname "${TARGET}")" ln -s -f "${file}" "${TARGET}" done