-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoom.sh
More file actions
executable file
·30 lines (23 loc) · 818 Bytes
/
Copy pathdoom.sh
File metadata and controls
executable file
·30 lines (23 loc) · 818 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 -Eeuo pipefail
readonly REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly DOOM_CONFIG="$REPO_ROOT/config/doom"
[[ -d "$DOOM_CONFIG" ]] || {
printf 'error: Doom configuration is missing: %s\n' "$DOOM_CONFIG" >&2
exit 1
}
command -v git >/dev/null || {
printf 'error: git is required\n' >&2
exit 1
}
readonly TEMP_ROOT="$(mktemp -d)"
trap 'rm -rf -- "$TEMP_ROOT"' EXIT
git clone --depth 1 https://github.com/hlissner/doom-emacs "$TEMP_ROOT/emacs.d"
# shellcheck source=scripts/lib/install.sh
source "$REPO_ROOT/scripts/lib/install.sh"
backup_target "$HOME/.emacs.d"
run mv -- "$TEMP_ROOT/emacs.d" "$HOME/.emacs.d"
"$HOME/.emacs.d/bin/doom" install
install_tree_merge "$DOOM_CONFIG" "$HOME/.doom.d"
"$HOME/.emacs.d/bin/doom" sync
print_backup_summary