help-stow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ignore directories in stow


From: Rudra Banerjee
Subject: Ignore directories in stow
Date: Thu, 30 Apr 2020 06:35:47 +0000

Hi all,
I am relatively new in stow (using for last 6 months). While this is working fine for backing up my config files, it is actually storing unwanted files, and not obeying my .stow-local-ignore.

I am using a script to install stow all my stowed files:
cat ~/bin/stow.sh
#!/usr/bin/env bash

# This script will Stow all the dotfiles located in the ~/dotfiles folder.
# The -R flag is used to force a 'restow' which will remove any existing symlinks before attempting to Stow.

echo "Stowing Dotfiles...";

cd ~/Utility/configs
for file in *; do
  # Only run Stow on the directories in the dotfiles folder and not the individual files.
  # Using 'basename' strips the filepath from the directory name.
  if [ -d ${file} ]; then
    stow  $(basename $file) -t ~/
    echo "$(basename $file) stowed.";
  fi
done

# Return back to the your PWD from before you ran the script
cd ~-

echo 'All stowed';


Now, among many stowed files, lets take the example of vim: The path is:
~/Utility/configs/vim  which has the structure:
tree -a -L 2
.
├── .stow-local-ignore
├── .vim
│   ├── autoload
│   ├── plugged
│   ├── spell
│   └── UltiSnips
└── .vimrc


But, inside .vim, I don't want plugged and spells to be stowed, so, I have .stow-local-ignore:
 cat .stow-local-ignore
\.vim/plugged
\.vim/spell


But this is not working.  I have actually deleted those unwanted dir's and unlinked ~/.vim and restowed, but this does not work. As soon as those files are generated inside ~/.vim, it is stowed. 

How I ignore them?

Kindly help.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]