From 33adac1412095eba27e8d34a3f9d971092bc945f Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Tue, 4 Oct 2016 12:31:49 +1100 Subject: [PATCH] Add a generic way to prevent Stow folding overzealously, instead of hardcoding the handling --- .local/bin/dots | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.local/bin/dots b/.local/bin/dots index be518ac..829db05 100755 --- a/.local/bin/dots +++ b/.local/bin/dots @@ -1,4 +1,5 @@ #!/usr/bin/env zsh +zmodload zsh/mapfile bootstrap() { echo 'Bootstrapping your dotfiles...' >&2 @@ -10,7 +11,6 @@ bootstrap() { STOW=$DOTFILES/stow/.local/bin/stow fi - mkdir -p ~/.zsh && touch ~/.zsh/zhistory clone dots vim zsh || return $? link } @@ -49,7 +49,19 @@ link() { else echo "Linking $packages into $HOME now..." >&2 fi - $STOW -d $DOTFILES -t ~ $packages + + for nofold in $DOTFILES/${^packages}/.stow-no-fold(N); process-stow-no-fold $nofold + + $STOW -d $DOTFILES -t ~ --ignore '^\.stow-no-fold' $packages +} + +process-stow-no-fold() { + for file in ${(f)mapfile[$1]}; do + file=~/$file + [[ -e $file ]] && continue + mkdir -p ${file:h} + touch $file + done } status() {