Alow stowing of subfolders

Jonathan Hodgson 5 years ago
parent 70eaa3f54f
commit f17a01625f
  1. 2
      README.md
  2. 29
      install.sh

@ -6,6 +6,8 @@ My primary editor is vim, who's config is in a submodule because I often need to
I use [GNU Stow](https://www.gnu.org/software/stow/) to deploy my dotfiles. There is a helper script in the root of this directory called install.sh that runs the necessary stow commands. I use [GNU Stow](https://www.gnu.org/software/stow/) to deploy my dotfiles. There is a helper script in the root of this directory called install.sh that runs the necessary stow commands.
Each folder contains the configuration related to a program / tool. In most cases, this folder is stowed meaning all of it's contents are symlinked to the same place in my $HOME directory. However, there are instances (only shells/zsh at the moment) when I don't want the whole directory to be symlinked. If the directory contains a sub-directory called `STOW`, only the `STOW` directory is stowed.
The folder `LEGACY` is for things that I no longer use but might be of interest if you are the sort of person who likes looking at other people's dotfiles. The folder `LEGACY` is for things that I no longer use but might be of interest if you are the sort of person who likes looking at other people's dotfiles.
The folder `NOSTOW` is for things that I don't manage with stow. This includes a submodule for my DWM fork and configuration files that live outside my home directory. The folder `NOSTOW` is for things that I don't manage with stow. This includes a submodule for my DWM fork and configuration files that live outside my home directory.

@ -3,6 +3,19 @@
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $SCRIPT_DIR cd $SCRIPT_DIR
#Atts a slash if there isn't one at the end
slashIt(){
local str=$1
case "$str" in
*/)
echo "$str"
;;
*)
echo "$str/"
;;
esac
}
doStow(){ doStow(){
local tostow=( local tostow=(
"bin" "bin"
@ -18,10 +31,18 @@ doStow(){
"vim" "vim"
"x" "x"
"zathura" "zathura"
"shells/zsh"
) )
for i in ${tostow[*]}; do for i in ${tostow[*]}; do
stow $i if [ -d "$SCRIPT_DIR/$i/STOW" ]; then
cd "$SCRIPT_DIR/$i"
stow -t $HOME STOW
else
cd $(dirname $i)
stow -t $HOME $(basename $i)
fi
cd $SCRIPT_DIR
done done
} }
@ -31,10 +52,12 @@ pacmanInstall(){
"zsh" "zsh"
"git" "git"
"pandoc" "pandoc"
"stow"
) )
if pacman -Qs $package > /dev/null; then if pacman -Qs $package > /dev/null; then
echo "Install $i"
fi fi
} }
dostow doStow

Loading…
Cancel
Save