-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·41 lines (30 loc) · 1.07 KB
/
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
#!/usr/bin/env bash
# https://stackoverflow.com/a/246128/1714661
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
echo "script dir: $SCRIPT_DIR"
cd
#mv .emacs .emacs.prior_install
echo "The new .emacs file will be:"
echo "-----"
sed "s|GIT_REPO_DIR|$SCRIPT_DIR|g" $SCRIPT_DIR/literate-version-setup/emacs.el
echo "-----"
echo "trying to remove .emacs if exists"
rm .emacs || true
echo "writing custom .emacs"
sed "s|GIT_REPO_DIR|$SCRIPT_DIR|g" $SCRIPT_DIR/literate-version-setup/emacs.el > .emacs
#ln -s $SCRIPT_DIR/literate-version-setup/emacs.el .emacs
echo "removing .emacs.d if exists"
rm -Rf .emacs.d || true
echo "making new .emacs.d"
mkdir -p .emacs.d
cd .emacs.d
echo "removing early-init.el if necessary"
rm early-init.el || true
echo "linking early-init.el"
ln -s $SCRIPT_DIR/literate-version-setup/early-init.el
cd $SCRIPT_DIR
echo "starting emacs to install packages..."
emacs --eval '(kill-emacs)'
echo "finalizing installation..."
emacs --eval '(progn install-all-the-icons-fonts nerd-icons-install-fonts pdf-tools-install)'
echo "done!"