diff options
Diffstat (limited to '.local/bin/emacs-install')
| -rwxr-xr-x | .local/bin/emacs-install | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/.local/bin/emacs-install b/.local/bin/emacs-install index b8a98aa..301d897 100755 --- a/.local/bin/emacs-install +++ b/.local/bin/emacs-install @@ -2,18 +2,22 @@ set -eux -build=${EMACS_BUILD:-.} +build_dir=${EMACS_BUILD:-.} + +cd "${build_dir}" +make install # 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_dir=$(sed -n s/'^prefix *= *'//p Makefile) +apps_dir=~/apps -[[ ${prefix} =~ ~/apps/(.*) ]] || exit -target=${BASH_REMATCH[1]} +case ${prefix_dir} +in + ${apps_dir}/*) target=${prefix_dir##${apps_dir}/} ;; + *) exit ;; +esac -cd ~/apps +cd ${apps_dir} ln -fsvT "${target}" emacs |
