-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·38 lines (29 loc) · 977 Bytes
/
setup.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
#!/usr/bin/env bash
set -euo pipefail
if [ -z "${LOGGING_DOTFILES_SETUP:-}" ]; then
echo "# $(date)" >"$HOME/.dotfiles-setup.log"
LOGGING_DOTFILES_SETUP=1 exec "$0" >>"$HOME/.dotfiles-setup.log" 2>&1
fi
set -x
homesick_repos="$HOME/.homesick/repos"
preferred_dir="$homesick_repos/dotfiles"
homeshick_dir="$homesick_repos/homeshick"
current_dir=$(cd "$(dirname "$0")" && pwd)
if [ "$current_dir" != "$preferred_dir" ]; then
mkdir -p "$(dirname "$preferred_dir")"
mv "$current_dir" "$preferred_dir"
fi
cd "$preferred_dir"
git submodule init
git submodule update
if [ ! -d "$homeshick_dir" ]; then
git clone https://github.com/andsens/homeshick.git "$homeshick_dir"
fi
"$homeshick_dir/bin/homeshick" link -f dotfiles
if [ ! -e "$HOME/.gnupg/pubring.kbx" ]; then
mkdir -p "$HOME/.gnupg"
chmod 700 "$HOME/.gnupg"
gpg --import <"$preferred_dir/misc/key.pub"
echo "304E3D8D4A14C451DBA5582AC341950C47B6CE14:6:" | gpg --import-ownertrust
fi
curl https://mise.run | sh