summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/emacs-install19
1 files changed, 19 insertions, 0 deletions
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