aboutsummaryrefslogtreecommitdiff
path: root/installer/installer.sh
blob: fafe6df4a0a9f0601a50d0332a99643671713c17 (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://github.com/Etenil/emacs-substrate.git

# 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!"