summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-06-12 16:39:56 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-06-12 16:39:56 +0100
commitdaa735a9e7e9482ca4b5d213fc2fbfba0c115f87 (patch)
tree8da1d0fc193a28be43de3d90a409c2b5d5f3fe71
parentdf3407c9403fd7e68301008f80ce57e8550ed1d5 (diff)
Replace $HOME with full path to user's home directory as $HOME expands
to /root
-rw-r--r--gohan.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/gohan.sh b/gohan.sh
index 2131aca..cb35b83 100644
--- a/gohan.sh
+++ b/gohan.sh
@@ -72,8 +72,8 @@ install_dotfiles() {
dialog --infobox "Downloading and installing dotfiles..." 4 60
[ ! -d "$2" ] && mkdir -p "$2" && chown -R "$name":"$name" "$2"
sudo -u "$name" git clone --bare --depth 1 "$1" "$2" >/dev/null 2>&1
- sudo -u "$name" git --git-dir="$2" --work-tree=$HOME checkout
- sudo -u "$name" git --git-dir="$2" --work-tree=$HOME config --local status.showUntrackedFiles no
+ sudo -u "$name" git --git-dir="$2" --work-tree="/home/$name" checkout
+ sudo -u "$name" git --git-dir="$2" --work-tree="/home/$name" config --local status.showUntrackedFiles no
}
install_software() {
@@ -118,7 +118,7 @@ preinstall_msg || error "User exited."
add_user || error "Error adding username and/or password."
-install_dotfiles $dotfilesrepo "/home/$name/.local/src"
+install_dotfiles $dotfilesrepo "/home/$name/.local/src/dotfiles"
install_software