Created
February 5, 2016 16:23
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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