30 lines
595 B
Bash
Executable file
30 lines
595 B
Bash
Executable file
#!/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
|