-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·29 lines (21 loc) · 877 Bytes
/
deploy.sh
File metadata and controls
executable file
·29 lines (21 loc) · 877 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
#! /bin/bash -
# Minimum emacs version and repo url
EMACS_VERSION=24.3
DOTEMACS_REPO=https://github.com/thisirs/dotemacs.git
# Do some preliminary checks
hash git > /dev/null 2>&1 \
|| { echo >&2 "git not installed. Aborting."; exit 1; }
hash emacs > /dev/null 2>&1 \
|| { echo >&2 "emacs not installed. Aborting."; exit 1; }
emacs -Q --batch --eval "(kill-emacs (if (version< emacs-version \"$EMACS_VERSION\") 1 0))" > /dev/null 2>&1 \
|| { echo >&2 "emacs > $EMACS_VERSION required."; exit 1; }
# Backup existing .emacs and .emacs.d
if [ -e "$HOME/.emacs" ]; then
echo "Moving existing ~/.emacs to ~/.emacs-$(date +%s).old"
mv $HOME/.emacs{,-$(date +%s).old}
fi
if [ -e "$HOME/.emacs.d" ]; then
echo "Moving existing ~/.emacs.d to ~/.emacs.d-$(date +%s).old"
mv $HOME/.emacs.d{,-$(date +%s).old}
fi
git clone $DOTEMACS_REPO $HOME/.emacs.d