-
Notifications
You must be signed in to change notification settings - Fork 0
/
stow.sh
executable file
·56 lines (45 loc) · 1.05 KB
/
stow.sh
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
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -e
df:stow() {
package_name=$1
shift
path=$1
shift
local full_path
if [ -z "$APPEND_PACKAGE_NAME" ]; then
full_path="$path"
else
full_path="$path/$package_name"
fi
if ! [ -d "$package_name" ]; then
echo "$package_name" dir does not exist in dotfiles
return 1
fi
mkdir -p "$full_path"
cp -fr "$package_name" "$full_path"
# Restow has weird output that is totally spurious
# See: https://github.com/aspiers/stow/issues/65
echo "Stowing $package_name"
stow -R "$package_name" -t "$full_path" "$@" || stow --adopt "$package_name" -t "$full_path" "$@"
}
df:stow:config() {
APPEND_PACKAGE_NAME=1 df:stow "$1" ~/.config
}
df:stow:home() {
df:stow "$1" ~
}
df:stow:config i3
df:stow:config kitty
df:stow:config nvim
df:stow:config tmux
df:stow:config skhd
df:stow:config yabai
# TODO: Remove this '|| true' when nix is everywhere
df:stow:config nix || true
APPEND_PACKAGE_NAME=1 df:stow scripts ~
df:stow:home safebase
df:stow:home scan
df:stow ssh ~/.ssh --adopt
df:stow:home xinit
df:stow:home zsh
df:stow:home shellcheck