From 30f89f49cf0a68454f95b5baa4b7db5f23c51c9d Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sun, 30 Jan 2022 23:10:21 -0500 Subject: [PATCH] bin: Add `ep` command to Edit on Path This is one of those things I use quite frequently to quickly edit my own personal scripts! It obviously fails for binaries, but it's nice to see the source of packaged scripts too! --- bin/ep | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/ep diff --git a/bin/ep b/bin/ep new file mode 100755 index 0000000..e1fbcf1 --- /dev/null +++ b/bin/ep @@ -0,0 +1,14 @@ +#!/bin/sh +die() { + echo "$*" 1>&2 + exit 1 +} + +[ -z "$1" ] && die "usage: $0 COMMAND" + +comm="$(command -v "$1")" +if [ -n "$comm" ]; then + exec "$EDITOR" "$comm" +else + die "File '$1' not on \$PATH" +fi -- libgit2 1.1.1