From 4a7d1fa68b9ec9c3aefc741a22348f604b973a11 Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Wed, 12 Feb 2025 07:16:48 +0000 Subject: Added installer --- README.md | 10 ++++++++++ installer/installer.sh | 22 +++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) mode change 100644 => 100755 installer/installer.sh 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 old mode 100644 new mode 100755 index 6b0bd56..e147657 --- 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 + -- cgit v1.2.3