dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit b4a76491970d4ebaab7c7c8af1ccb10212c01d68
parent a6f72ff67bb6aec6686b84df45098bffb13f91d1
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sun, 26 Jan 2025 17:09:58 +0100

Automate some Emacs installation tedium

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 🧘

Diffstat:
A.local/bin/emacs-install | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/.local/bin/emacs-install 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