Add simple stow automatic linking script

This commit is contained in:
Marty Oehme 2019-12-30 00:02:17 +01:00
parent d34cecb27e
commit 34779454be

30
stow.sh Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
#
# Stow automatic symlinking script
#
# Invokes stow for every folder within this repository, and that's it.
# to_stow=$(ls -l --time-style="long-iso" . | grep -E '^d' | awk '{print $8}')
stow_dirs() {
for d in */; do
printf "stowing %s\n" "$d"
stow "$d"
done
}
have_stow() {
type stow >/dev/null 2>&1 || printf "GNU stow needs to be installed for this script to function. Please install stow through your package manager.\n"
exit 1
}
while [ "$1" != "" ]; do
case "$1" in
-s | --stow)
have_stow
stow_dirs
exit
;;
esac
shift
done