Created
May 5, 2024 20:54
-
-
Save mhrstmnn/ae6a95e978142d9fec12a3e89e243de1 to your computer and use it in GitHub Desktop.
Zsh script to stow directories in a directory
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 | |
# ANSI color codes | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
for directory in */; do | |
directory="${directory%/}" | |
echo -n "Stowing $directory ... " | |
if stow -t "$HOME" "$directory"; then | |
echo -e "${GREEN}Stowed $directory successfully.${NC}" | |
else | |
echo -e "${RED}Error: Failed to stow $directory.${NC}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment