From dedf1c1c1771b2a555448aca6d4796ec06df38d2 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 28 Aug 2024 11:56:08 +0200 Subject: Don't require GNU Emacs to be installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- install.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index c887a45..8476371 100755 --- a/install.sh +++ b/install.sh @@ -19,7 +19,7 @@ set -e ## # Let's ask for some dependencies and nice-to-have binaries. -binaries=(git curl vim emacs) +binaries=(git curl vim) for bin in "${binaries[@]}"; do if ! [ -x "$(command -v ${bin})" ]; then echo "Error: the binary '${bin}' is not installed." >&2 @@ -70,19 +70,23 @@ done ## # GNU Emacs: just install Doom and take it from there. -rm -rf "${HOME:?}/.config/doom" -ln -s "$(readlink -f .config/doom)" "${HOME:?}/.config/doom" +if [ -x "$(command -v emacs)" ]; then + rm -rf "${HOME:?}/.config/doom" + ln -s "$(readlink -f .config/doom)" "${HOME:?}/.config/doom" -if [ -d "${HOME:?}/.config/emacs" ]; then - if [ -x "$(command -v doom)" ]; then - doom upgrade + if [ -d "${HOME:?}/.config/emacs" ]; then + if [ -x "$(command -v doom)" ]; then + doom upgrade + fi + else + git clone https://github.com/hlissner/doom-emacs "${HOME:?}/.config/emacs" fi + + "${HOME:?}/.config/emacs/bin/doom" install else - git clone https://github.com/hlissner/doom-emacs "${HOME:?}/.config/emacs" + echo "Skipping GNU Emacs setup." fi -"${HOME:?}/.config/emacs/bin/doom" install - ## # Other stuff -- cgit v1.2.3