bootstrap/stower.sh

27 lines
401 B
Bash
Raw Normal View History

#!/bin/bash
targets="$@"
for t in $targets
do
if [ -d "$t" ]
then
echo "Stowing $t"
if [ -e "$t/PRESTOW" ]
then
echo "Running $t/PRESTOW"
"$t/PRESTOW"
fi
stow -t"$HOME" --ignore="^PRESTOW$" --ignore="^POSTSTOW$" "$t"
if [ -e "$t/POSTSTOW" ]
then
echo "Running $t/POSTSTOW"
"$t/POSTSTOW"
fi
else
echo "target $t does not exist or is not a directory"
exit
fi
done