From 5238ad5a0c4a9e1c8cd036f5de4055e39bd71297 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 29 Apr 2011 09:09:27 +0200 Subject: added debootstrap stuff Signed-off-by: Manuel Traut --- beagle/debian-rfs/usr/bin/sensible-editor | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 beagle/debian-rfs/usr/bin/sensible-editor (limited to 'beagle/debian-rfs/usr/bin/sensible-editor') diff --git a/beagle/debian-rfs/usr/bin/sensible-editor b/beagle/debian-rfs/usr/bin/sensible-editor new file mode 100755 index 0000000..8e4c9e4 --- /dev/null +++ b/beagle/debian-rfs/usr/bin/sensible-editor @@ -0,0 +1,32 @@ +#!/bin/sh + +ret="$?" + +if [ -n "$VISUAL" ]; then + ${VISUAL} "$@" + ret="$?" + if [ "$ret" -ne 126 ] && [ "$ret" -ne 127 ]; then + exit "$ret" + fi +fi + +${EDITOR:-editor} "$@" +ret="$?" +if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then + nano "$@" + ret="$?" + if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then + nano-tiny "$@" + ret="$?" + if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then + vi "$@" + ret="$?" + if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then + echo "Couldn't find an editor!" 1>&2 + echo "Set the \$EDITOR environment variable to your desired editor." 1>&2 + exit 1 + fi + fi + fi +fi +exit "$ret" -- cgit v1.2.3