diff --git a/install b/install index b8f4c79..e0efebd 100755 --- a/install +++ b/install @@ -3,13 +3,15 @@ set -euo pipefail cd -- "$(dirname -- "$0")" function main() { + local home local dotfile + home=$(eval echo ~"${SUDO_USER:-$(id -un)}") for dotfile in .*; do [[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue dotfile=$(realpath "$dotfile") ( - cd + cd -- "$home" ln -svf "$dotfile" . ) done