Skip to content

Instantly share code, notes, and snippets.

@gerrard00
Created February 5, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerrard00/1c633d233d2c48b8398a to your computer and use it in GitHub Desktop.
Save gerrard00/1c633d233d2c48b8398a to your computer and use it in GitHub Desktop.
A lil' zsh script to check what stow has stowed before you stow. Run it in the root of your dotfiles repo.
#! /bin/zsh
DEFAULT_WARNING="WARNING: in simulation mode so not modifying filesystem."
for folder in */; do
# for folder in */; do
echo "- ${folder}";
# capture stderr, but send stdout to /dev/tty like normal
output="$(stow -n -v ${folder} 2>&1)"
lines=("${(@f)output}")
for line in $lines; do
if [[ $line != $DEFAULT_WARNING ]]; then
echo "\t$line"
fi
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment