From ac6754f5ff14254e871b8e100a8f990387df9f0b Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 00:49:35 +0200 Subject: cobra: initial index.sh --- cobra/index.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 cobra/index.sh (limited to 'cobra/index.sh') diff --git a/cobra/index.sh b/cobra/index.sh new file mode 100755 index 00000000..e3c5a1ea --- /dev/null +++ b/cobra/index.sh @@ -0,0 +1,20 @@ +#! /bin/sh +set -euf +trap "echo 'You are made of stupid!' >&2; exit 23" EXIT +disarm() { + trap - EXIT +} + +COBRA_PATH="${COBRA_PATH-$PWD}" + +## main +for target; do + for path in $COBRA_PATH; do + if test -d "$path/$target"; then + if index="$path/$target/index.sh" && test -f "$index"; then + exec /bin/sh "$index" + disarm + fi + fi + done +done -- cgit v1.2.3 From 1dc3083211674137b8667b489f39ad8d2f9db5e3 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 00:52:46 +0200 Subject: cobra needs no disarm --- cobra/index.sh | 4 ---- 1 file changed, 4 deletions(-) (limited to 'cobra/index.sh') diff --git a/cobra/index.sh b/cobra/index.sh index e3c5a1ea..1118a823 100755 --- a/cobra/index.sh +++ b/cobra/index.sh @@ -1,9 +1,6 @@ #! /bin/sh set -euf trap "echo 'You are made of stupid!' >&2; exit 23" EXIT -disarm() { - trap - EXIT -} COBRA_PATH="${COBRA_PATH-$PWD}" @@ -13,7 +10,6 @@ for target; do if test -d "$path/$target"; then if index="$path/$target/index.sh" && test -f "$index"; then exec /bin/sh "$index" - disarm fi fi done -- cgit v1.2.3