# HG changeset patch # User Meredith Howard # Date 1624156999 18000 # Node ID 55a1c83b3417148f1d0ad45c90deec843200dac6 # Parent 54729706345b65dffa6fd454db9d90b81448c18e spin out stubexec diff --git a/.lib/sh/stubexec.sh b/.lib/sh/stubexec.sh new file mode 100644 --- /dev/null +++ b/.lib/sh/stubexec.sh @@ -0,0 +1,6 @@ +stubexec() { + local real_bin="$(which -a $(basename $0) | grep -v $0 | head -n 1)" + if [ -x "$real_bin" ]; then + exec $real_bin $* + fi +} diff --git a/bin/cpm b/bin/cpm new file mode 100755 --- /dev/null +++ b/bin/cpm @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +. ~/.lib/sh/stubexec.sh + +stubexec $* + +curl -fsSL --compressed https://git.io/cpm | + perl - install -g App::cpm + +plenv rehash || : + +stubexec $* diff --git a/bin/pg_format b/bin/pg_format --- a/bin/pg_format +++ b/bin/pg_format @@ -1,16 +1,10 @@ #!/bin/sh set -eu - -stubexec() { - local real_bin="$(which -a $(basename $0) | grep -v $0 | head -n 1)" - if [ -x "$real_bin" ]; then - exec $real_bin $* - fi -} +. ~/.lib/sh/stubexec.sh stubexec $* cpanm -n 'https://github.com/darold/pgFormatter.git' -plenv rehash +plenv rehash || : stubexec $*