-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
47 lines (34 loc) · 992 Bytes
/
install.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
#!/bin/sh
# XDG
if [[ -z "$XDG_CONFIG_HOME" ]]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
if [[ -z "$XDG_CACHE_HOME" ]]; then
export XDG_CACHE_HOME="$HOME/.cache"
fi
if [[ -z "$XDG_DATA_HOME" ]]; then
export XDG_DATA_HOME="$HOME/.local/share"
fi
if [[ -z "$XDG_STATE_HOME" ]]; then
export XDG_STATE_HOME="$HOME/.local/state"
fi
if [[ -z "$XDG_DATA_DIRS" ]]; then
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi
if [[ -z "$XDG_CONFIG_DIRS" ]]; then
export XDG_CONFIG_DIRS="/etc/xdg"
else
export XDG_CONFIG_DIRS="/etc/xdg:$XDG_CONFIG_DIRS"
fi
cd "$HOME" || exit
git clone https://github.com/mcchrish/dotfiles .dotfiles
cd .dotfiles || exit
if ! (command -v brew > /dev/null); then
echo "Installing brew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Install all programs..."
/opt/homebrew/bin/brew bundle install
echo "Apply config files..."
/opt/homebrew/bin/chezmoi apply
echo "Done. :)"