-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstow.sh
More file actions
executable file
·30 lines (24 loc) · 767 Bytes
/
stow.sh
File metadata and controls
executable file
·30 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
set -e
# Colors using tput
if [[ -t 1 ]]; then
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
else
GREEN='' YELLOW='' RESET=''
fi
# Check if stow is installed
if ! command -v stow &> /dev/null; then
echo "Error: stow is not installed"
echo "Install it with: brew install stow"
exit 1
fi
# Get script directory and change to it
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "${YELLOW}Stowing dotfiles...${RESET}"
# Stow all directories except those in .stow-local-ignore
# The --restow flag handles both new and existing packages
stow --restow --verbose=1 --target="$HOME" */ 2>&1 | grep -E "LINK|UNLINK" | sed 's/^/ /' || true
echo "${GREEN}✓ Done!${RESET}"