mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Actually a part of statd, but had to make a separarate package to get it to work. Statd helper-scripts are now pre-compiled instead of doing it in runtime. Fixes #379
30 lines
559 B
Bash
Executable File
30 lines
559 B
Bash
Executable File
#!/bin/sh
|
|
|
|
SCRIPT_PATH="$(dirname "$(readlink -f "$0")")"
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: $0 JSON-FILE COMMAND [ ARGS ]"
|
|
exit 1
|
|
fi
|
|
|
|
json=$1; shift
|
|
command=$1; shift
|
|
|
|
echo "1..1"
|
|
|
|
if [ ! -e "$SCRIPT_PATH/$json" ]; then
|
|
echo "not ok 1 - $SCRIPT_PATH/$json not found"
|
|
exit 1
|
|
fi
|
|
|
|
cat "$SCRIPT_PATH/$json" | \
|
|
"$SCRIPT_PATH"/../../../src/statd/python/cli_pretty/cli_pretty.py \
|
|
"$command" $*
|
|
if [ $? -eq 0 ]; then
|
|
echo "ok 1 - $json printed without crashing"
|
|
exit 0
|
|
fi
|
|
|
|
echo "not ok 1 - $json printing returned non zero"
|
|
exit 1
|