aboutsummaryrefslogtreecommitdiff
path: root/installer/installer.sh
blob: b2308f392bcc71be412281e4242a12ba60d1d8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

EMACS_DIR="${EMACS_DIR:-$HOME/.emacs.d}"

if [ ! -d $EMACS_DIR ]; then
    mkdir -p $EMACS_DIR
fi

if [ -f "$EMACS_DIR/init.el" ]; then
    echo "Existing emacs config detected! Please remove the file '$EMACS_DIR/init.el' to continue."
    exit 1
fi

# Clone emacs-substrate
pushd $EMACS_DIR
git clone https://git.etenil.net/emacs-substrate

# Download and prep early-init.el
sed "s%INSTALL_PATH%$EMACS_DIR/emacs-substrate%g" < emacs-substrate/installer/early-init.el > "$EMACS_DIR/early-init.el"
cp emacs-substrate/installer/init.el init.el

popd

echo "All done! Enjoy Emacs Substrate!"