From b4a76491970d4ebaab7c7c8af1ccb10212c01d68 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 26 Jan 2025 17:09:58 +0100 Subject: Automate some Emacs installation tedium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mostly to stop feeling guilty about not first-trying the ln invocation. Of course now I feel guilty about my half-assed prefix parsing. C'est la vie 🧘 --- .local/bin/emacs-install | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 .local/bin/emacs-install diff --git a/.local/bin/emacs-install b/.local/bin/emacs-install new file mode 100755 index 0000000..b8a98aa --- /dev/null +++ b/.local/bin/emacs-install @@ -0,0 +1,19 @@ +#!/bin/bash + +set -eux + +build=${EMACS_BUILD:-.} + +# Retrieve installation directory. Many ways to do this; parsing +# 'config.status --config' might be TRT in principle; for simplicity, +# just: +prefix=$(sed -n s/'^prefix *= *'//p "${build}"/Makefile) + +cd "${build}" +make install + +[[ ${prefix} =~ ~/apps/(.*) ]] || exit +target=${BASH_REMATCH[1]} + +cd ~/apps +ln -fsvT "${target}" emacs -- cgit v1.2.3