2015-12-10 15:52:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# Parse the output of fiddle_main, for use in testing
|
|
|
|
while IFS= read -r line; do
|
|
|
|
type=$(echo $line | sed -n 's/[^"]*"\([^"]*\)":.*/\1/p')
|
|
|
|
if [ "$type" ]; then
|
|
|
|
case "$type" in
|
2017-06-01 17:24:11 +00:00
|
|
|
Raster|Gpu) ext='.png';;
|
|
|
|
Pdf) ext='.pdf';;
|
|
|
|
Skp) ext='.skp';;
|
|
|
|
Text|GLInfo) ext='.txt';;
|
2015-12-10 15:52:45 +00:00
|
|
|
esac
|
|
|
|
dst="${TMPDIR:-/tmp}/fiddle_${type}${ext}"
|
|
|
|
echo $line | sed 's/[^"]*"[^"]*": "//; s/"\(,\|\)$//' \
|
|
|
|
| base64 -d > "$dst"
|
|
|
|
echo $dst
|
|
|
|
fi
|
|
|
|
done
|