Skip to content

Instantly share code, notes, and snippets.

@mhrstmnn
Created May 5, 2024 20:54
Show Gist options
  • Save mhrstmnn/ae6a95e978142d9fec12a3e89e243de1 to your computer and use it in GitHub Desktop.
Save mhrstmnn/ae6a95e978142d9fec12a3e89e243de1 to your computer and use it in GitHub Desktop.
Zsh script to stow directories in a directory
#!/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