summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-editors/gentoo-editor/files/gentoo-editor-2.sh')
-rw-r--r--app-editors/gentoo-editor/files/gentoo-editor-2.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/app-editors/gentoo-editor/files/gentoo-editor-2.sh b/app-editors/gentoo-editor/files/gentoo-editor-2.sh
new file mode 100644
index 000000000000..6f1dd4a50590
--- /dev/null
+++ b/app-editors/gentoo-editor/files/gentoo-editor-2.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the MIT/X11 license
+
+# Editor wrapper script, executes ${EDITOR} with arguments $@
+
+if [ -z "${EDITOR}" ]; then
+ # Try to get EDITOR from system profile
+ EDITOR=$(. /etc/profile &>/dev/null; echo "${EDITOR}")
+fi
+
+if [ -z "${EDITOR}" ]; then
+ echo "$0: The EDITOR variable must be set" >&2
+ exit 1
+fi
+
+exec ${EDITOR} "$@"