summary refs log tree commit diff
path: root/bin/edit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/edit.sh')
-rw-r--r--bin/edit.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/edit.sh b/bin/edit.sh
new file mode 100644
index 00000000..c276707f
--- /dev/null
+++ b/bin/edit.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -eu
+
+script=$(mktemp)
+trap "rm -f '$script'" EXIT
+
+sed "s/.*/${1:-: &}/" >> "$script"
+$EDITOR "$script"
+sh -eux "$script"