sudo -u "$name" git -C "$repodir" clone -q "$1" "$dir" 2>/dev/null ||
{ cd "$dir" || return 1; sudo -u "$name" git pull --force origin master 2>/dev/null || return 1; }
cd "$repodir" || return 1
- sudo -u "$name" stow -t "/home/$name" "$progname"
+ # --no-folding: without this, stow will collapse an entire empty target
+ # directory (e.g. ~/.local/bin) into a single symlink into this repo
+ # instead of symlinking the files inside it individually. That breaks
+ # anything else that writes into the same directory later (e.g. pipx,
+ # npm) by making it write straight into the git working tree.
+ sudo -u "$name" stow --no-folding -t "/home/$name" "$progname"
[ -f "$dir/Makefile" ] && { cd "$dir" || return 1; make install >/dev/null 2>&1; }
cd /tmp || return 1
}