summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Eet.am1
-rwxr-xr-xsrc/bin/eet/vieet59
2 files changed, 60 insertions, 0 deletions
diff --git a/src/Makefile_Eet.am b/src/Makefile_Eet.am
index 05e9acb197..b8540f511e 100644
--- a/src/Makefile_Eet.am
+++ b/src/Makefile_Eet.am
@@ -37,6 +37,7 @@ EXTRA_DIST += static_libs/lz4/README
37### Binary 37### Binary
38 38
39bin_PROGRAMS += bin/eet/eet 39bin_PROGRAMS += bin/eet/eet
40bin_SCRIPTS += bin/eet/vieet
40 41
41bin_eet_eet_SOURCES = bin/eet/eet_main.c 42bin_eet_eet_SOURCES = bin/eet/eet_main.c
42 43
diff --git a/src/bin/eet/vieet b/src/bin/eet/vieet
new file mode 100755
index 0000000000..8c38a10300
--- /dev/null
+++ b/src/bin/eet/vieet
@@ -0,0 +1,59 @@
1#!/bin/sh
2
3function cleanup() {
4 if [ ! -z "$TFILE" ]; then
5 rm "$TFILE"
6 fi
7}
8
9function die() {
10 echo "$@"
11 echo "Aborting"
12 cleanup
13 exit 1
14}
15
16function usage() {
17 die "Usage: vieet <eet file> <section>"
18}
19
20if [ $# -ne 2 ]; then
21 usage
22fi
23
24if [[ -z "$EDITOR" ]]; then
25 die "EDITOR env var must be set."
26fi
27
28EETFILE="$1"
29SECTION="$2"
30TFILE=$(mktemp)
31
32if [ $? -ne 0 ]; then
33 die "Failed creating tempfile."
34fi
35
36# Decode the file
37eet -d "$EETFILE" "$SECTION" "$TFILE"
38
39if [ $? -ne 0 ]; then
40 die "Failed decoding eet file."
41fi
42
43DONE=0
44
45while [ $DONE -ne 1 ]
46do
47 $EDITOR $TFILE
48
49 eet -e "$EETFILE" "$SECTION" "$TFILE" 1
50 if [ $? -ne 0 ]; then
51 echo "Failed compiling eet file."
52 echo "Press 'Return' to reopen the editor, or ^C to abort."
53 read
54 else
55 DONE=1
56 fi
57done
58
59cleanup