aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2025-02-12 07:16:48 +0000
committerGene Pasquet <dev@etenil.net>2025-02-12 07:16:48 +0000
commit4a7d1fa68b9ec9c3aefc741a22348f604b973a11 (patch)
treeb14ebd25028b33f2fe2bdb7527953c94eff21474
parenta7406fb2a375bdc358361349c30850f8e523b46f (diff)
Added installer
-rw-r--r--README.md10
-rwxr-xr-x[-rw-r--r--]installer/installer.sh22
2 files changed, 31 insertions, 1 deletions
diff --git a/README.md b/README.md
index 961aeca..ed4d982 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,16 @@ This is a minimal Emacs base config. Here's the short of the philosophy:
## Installation
+### With automated script
+
+Copy and paste the following into a terminal:
+
+```
+curl
+```
+
+### Manually
+
To install emacs-substrate, clone this repository somewhere, then create the following 2 files:
```lisp
diff --git a/installer/installer.sh b/installer/installer.sh
index 6b0bd56..e147657 100644..100755
--- a/installer/installer.sh
+++ b/installer/installer.sh
@@ -1,3 +1,23 @@
#!/usr/bin/env bash
-# TODO
+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
+