Alow stowing of subfolders

This commit is contained in:
Jonathan Hodgson 2019-08-01 18:02:40 +01:00
parent 34d4dc829e
commit 721436b983
2 changed files with 28 additions and 3 deletions

View file

@ -3,6 +3,19 @@
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
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(){
local tostow=(
"bin"
@ -18,10 +31,18 @@ doStow(){
"vim"
"x"
"zathura"
"shells/zsh"
)
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
}
@ -31,10 +52,12 @@ pacmanInstall(){
"zsh"
"git"
"pandoc"
"stow"
)
if pacman -Qs $package > /dev/null; then
echo "Install $i"
fi
}
dostow
doStow