-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstow-util.sh
More file actions
executable file
·45 lines (38 loc) · 828 Bytes
/
Copy pathstow-util.sh
File metadata and controls
executable file
·45 lines (38 loc) · 828 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
blacklist=(
".git"
".gitsubmodules"
".gitignore"
"tmux"
"wsl-term"
"tmp"
"kickstart.nvim"
)
cd ~/.dotfiles || exit
packages=$(ls -d */)
for package in $packages; do
package_name="${package%/}"
skip=false
for ignored in "${blacklist[@]}"; do
if [[ "$package_name" == "$ignored" ]]; then
skip=true
break
fi
done
if $skip; then
echo "Skipped: $package_name"
continue
fi
if [[ "$package" == "bash/" ]]; then
stow "$package_name"
for file in "$package_name"/.*; do
file=$(basename "$file")
[[ "$file" == "." || "$file" == ".." ]] && continue
[[ -f ~/"$file" ]] && source ~/"$file"
done
echo "Stowed & Sourced: $package_name"
continue
fi
stow "$package_name"
echo "Stowed: $package_name"
done