.lib/sh/stubexec.sh

Fri, 24 Sep 2021 12:14:40 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 24 Sep 2021 12:14:40 -0500
changeset 948
92cb1b3e285a
parent 932
f87943eb16aa
child 957
ea852d545173
permissions
-rw-r--r--

This popup is busted and its annoying to update vimball plugins

realpath() {
  local dir="$(dirname -- "$1")"
  local file="$(basename -- "$1")"
  (cd "$dir" 2>/dev/null && printf '%s/%s\n' "$(pwd -P)" "$file")
}

stubexec() {
  local real_me="$(realpath "$0")"
  local real_bin="$(which -a $(basename $0) | grep -v "$real_me" | head -n 1)"
  if [ -x "$real_bin" ]; then
    exec $real_bin $*
  fi
}

mercurial