-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassthrough-outputinspector
More file actions
executable file
·59 lines (54 loc) · 1.15 KB
/
passthrough-outputinspector
File metadata and controls
executable file
·59 lines (54 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
usage()
{
echo
echo "Usage:"
echo "$0 <compiler/linter> <full-path-to-source>"
echo
echo "(currently only works with single-file statements)"
echo "Example:"
echo "$0 python3 $HOME/git/myproject/run.py"
echo
echo
}
if [ -z "$1" ]; then
usage
exit 1
fi
if [ -z "$2" ]; then
usage
exit 2
fi
passthrough_params=""
if [ ! -z "$3" ]; then
passthrough_params="$passthrough_params$3"
fi
if [ ! -z "$4" ]; then
passthrough_params="$passthrough_params$4"
fi
if [ ! -z "$5" ]; then
passthrough_params="$passthrough_params$5"
fi
if [ ! -z "$6" ]; then
passthrough_params="$passthrough_params$6"
fi
if [ ! -z "$7" ]; then
passthrough_params="$passthrough_params$7"
fi
if [ ! -z "$8" ]; then
passthrough_params="$passthrough_params$8"
fi
if [ ! -z "$9" ]; then
passthrough_params="$passthrough_params$9"
fi
# echo "extra outputinspector params: $passthrough_params"
if [ -f "$2" ]; then
# cd to directory of file (expand 0 then take only what is before slash)
echo "${2%/*}"
$1 $2 2>err.txt
outputinspector --ExitOnNoErrors=yes $passthrough_params
else
echo "WARNING: cannot find source file '$2'"
# usage
# exit 3
fi